前几天帮人做了个小软件,发给用户后,过了天便收到软件运行出错消息.当时真纳闷,在本机测试运行正常的.
错误信息如下 :

找不到方法 ”System.String
System.Windows.Forms.OpenFileDialog.get_SafeFileName()"。。
具体信息
转:找不到方法 system.Windows.forms.openfiledialog.get_safefileName()
打开源代码...找到到了OpenFileDialog.SafeFileName这句
测试,发现正常
然后查看MSDN,发现
--------------------------------
版本信息

.NET Framework受以下版本支持:3.5、3.0 SP1、2.0 SP1
------------------------------------
汗,原来客户那边没装2.0SP1补丁或以上版本,呵呵.修改哈源代码
由tbName.Text = openFileDialog1.SafeFileName
改成
tbName.Text = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf(@"/")+1);//获取选中的文件名
呵呵 。。搞定....

相关文章:

  • 2021-09-21
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2021-07-11
  • 2022-01-22
  • 2021-06-11
猜你喜欢
  • 2022-12-23
  • 2021-05-17
  • 2021-10-20
  • 2022-12-23
  • 2021-11-09
  • 2022-01-15
相关资源
相似解决方案