资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

FileStream不认识相对路径

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

在FileStream的构造函数和File.Exists方法中均不能使用相对路径指定文件,另外运行Directory.GetCurrentDirectory得到NotSupportedException异常,请问这是怎么回事?我使用.net   compact   framework(sp2),在PPC2003上调试.

网友回答:

发表者:juqiang)

第一个不知道,第二个,CE不支持GetCurrentDirectory方法,该方法只是为了与桌面兼容才存在的。你可以看msdn这个连接中,remarks最下面那行:  
  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiodirectoryclassgetcurrentdirectorytopic.asp  
   
  你可以这么做:  
  using   System.Reflection;  
  using   System.IO;  
   
  //   This   is   the   full   directory   and   exe   name  
  String   fullAppName   =   Assembly.GetExecutingAssembly().GetName().CodeBase;  
   
  //   This   strips   off   the   exe   name  
  String   fullAppPath   =   Path.GetDirectoryName(fullAppName);  
 

发表者:ms44

你啊.用PPC开发.早就应该预料到这些问题的了.  
  好好看他的SDK的文档资料


 

 
热门推荐笔记本: IBM笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved