现在的位置: 首页 > 综合 > 正文

一个在移动设备中获取路径的方法

2011年10月29日 ⁄ 综合 ⁄ 共 352字 ⁄ 字号 评论关闭
 一个在移动设备中获取路径的常用方法:
public string GetFileName()
{
  
return System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase),"filename");
}

  
    在移动设备开发中,路径都使用绝对路径。
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase 获得应用程序的基目录,然后与文件与装配,就得到了绝对路径。
   

抱歉!评论已关闭.