得到我的.exepath
我怎么能得到我的.exepath,因为如果我复制我的.exe我可以得到我的新path?
System.Reflection.Assembly.GetEntryAssembly().Location; 此外:
 AppDomain.CurrentDomain.BaseDirectory Assembly.GetEntryAssembly().Location 
在Windows窗体项目中:
 对于完整path(包含文件名): string exePath = Application.ExecutablePath; 
 仅适用于path: string appPath = Application.StartupPath; 
在visualstudio 2008中,您可以使用以下代码:
  var _assembly = System.Reflection.Assembly .GetExecutingAssembly().GetName().CodeBase; var _path = System.IO.Path.GetDirectoryName(_assembly) ;