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

获取运行文件路径

2013年04月25日 ⁄ 综合 ⁄ 共 218字 ⁄ 字号 评论关闭

 

string appPath =  Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);

 

另外一个不错方法:

 

string appPath = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);

抱歉!评论已关闭.