winform程序启动路径 Application.StartupPath;
aspl.net , winform 程序启动路径,
string str = System.AppDomain.CurrentDomain.BaseDirectory;
//获取当前进程的完整路径,包含文件名(进程名)。
string str = this.GetType().Assembly.Location;
result: X:/xxx/xxx/xxx.exe (.exe文件所在的目录+.exe文件名)
//获取和设置包含该应用程序的目录的名称。
string str = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
result: X:/xxx/xxx/ (.exe文件所在的目录+"/")
//获取当前进程的完整路径,包含文件名(进程名)。
string str = this.GetType().Assembly.Location;
result: X:/xxx/xxx/xxx.exe (.exe文件所在的目录+.exe文件名)
//获取当前进程的启动程序集的路径,包含文件名(进程名)。
Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
//获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。
string str = System.Environment.CurrentDirectory;