我想我的应用程序一样的路径:“\\ \\ PROGRAMFILES对myApp”,我尝试使用下面的代码:如何获取应用程序的路径(没有app.exe)?
string path = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
但它返回一个具有“\\ MyApp.exe的路径“ 最后。
我也试过:
string path = System.IO.Directory.GetCurrentDirectory();
但它抛出一个“NotSupportedException异常”。
有没有办法在最后得到没有.exe的路径?
很抱歉的混乱和感谢您的快速回答; P – 2009-05-19 08:10:07