//Gets the full path of the current process, including the file name (process name).
string str = this. GetType (). assembly.location;
result:x:\xxx\xxx\xxx.exe (. exe file in the same directory as +.exe filename)
//Gets the full path of the new process component and associates it with the main module associated with the currently active process, including the file name (process name).
string str = System.Diagnostics.Process.GetCurrentProcess (). Mainmodule.filename;
result:x:\xxx\xxx\xxx.exe (. exe file in the same directory as +.exe filename)
//Gets and sets the fully qualified path to the current directory (that is, the directory from which the process starts).
string str = System.Environment.CurrentDirectory;
result:x:\xxx\xxx (the directory where the. exe file resides)
//Gets the base directory of the current application domain for the current Thread, which is used by the Assembly resolver to probe assemblies.
string str = System.AppDomain.CurrentDomain.BaseDirectory;
result:x:\xxx\xxx\ (the directory where the. exe file is located + "\")
//Gets and sets the name of the directory that contains the application. (recommended)
string str = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
result:x:\xxx\xxx\ (the directory where the. exe file is located + "\")
//Gets the path to the executable file that launched the application, not including the name of the executable file.
string str = System.Windows.Forms.Application.StartupPath;
result:x:\xxx\xxx (the directory where the. exe file resides)
//Gets the path to the executable file that launched the application, including the name of the executable file.
string str = System.Windows.Forms.Application.ExecutablePath;
result:x:\xxx\xxx\xxx.exe (. exe file in the same directory as +.exe filename)
//Gets the current working directory of the application (unreliable).
string str = System.IO.Directory.GetCurrentDirectory ();
result:x:\xxx\xxx (the directory where the. exe file resides)
C # Gets a collection of methods for the current program run path