http://www.winu.cn/space-14160-do-blog-id-445.html
// Obtain the complete path of the new Process component and associate it with the active Process, including the file name (Process name ). String str = System. diagnostics. process. getCurrentProcess (). mainModule. fileName; result: X: \ xxx \ xxx.exe (.exe File Name of the Directory .exe file) // obtain and set the full path of the current directory (that is, the directory from which the process starts. String str = System. environment. currentDirectory; result: X: \ xxx (directory of the .exe file) // obtain the base Directory of the current application domain of the current Thread, which is used by the Assembly conflict resolution program to detect the assembly. String str = System. appDomain. currentDomain. baseDirectory; result: X: \ xxx \ (directory Of the. exe file + "\") // obtain and set the name of the directory containing the application. String str = System. appDomain. currentDomain. setupInformation. applicationBase; result: X: \ xxx \ (directory where the .exe file is located + "\") // obtain the path of the executable file that started the application, the name of the executable file is not included. String str = System. windows. forms. application. startupPath; result: X: \ xxx (directory of the .exe file) // obtain the path of the executable file that started the application, including the name of the executable file. String str = System. Windows. Forms. Application. ExecutablePath; result: X: \ xxx \ xxx.exe (.exefile directory. .exe file name) // obtain the current working directory of the Application (unreliable ). String str = System. IO. Directory. GetCurrentDirectory (); result: X: \ xxx (directory of the .exe file)