1:获取当前目录的完全限定路径
string str=System.Environment.CurrentDirectory;
2:获取相对路径
string str=System.Windows.Forms.Application.StartupPath;
3:获取相对路径
string str=System,Diagnostics.Pricess.GetCurrentPricess().MainModele.FileName;
4:获取当前应用程序的工作目录
string str=System.IO.Directiry.GetCurrentDirectory();
5:获取当前工作目录
string str=System.AppDoMAIN.CurrentDomain.BaseDirectory;
6:获取和设置包含该应用程序的目录的名称
string str=System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
7 :获取相对路径
获取当前进程的完整路径,包含文件名
string str=this.GetType().Assembly.Location;
8:获取启动了应用程序中的可执行文件的路径,包括可执行文件的名称
string str=System.Windows.Forms.Application.ExecutablePath;