C # multiple methods to obtain the file path,
String str5 = Application. StartupPath; // obtain the path of the executable file that started the Application, excluding the name of the executable file.
String str1 = Process. GetCurrentProcess (). MainModule. FileName; // obtain the file name of the currently executed exe.
String str2 = Environment. CurrentDirectory; // gets and sets the fully qualified path of the current directory (that is, the directory from which the process starts.
// The remarks are as defined. if the process is started in the local or root directory of the network drive, the value of this attribute is the drive name followed by a backslash (such as "C: /"). If the process is started in a subdirectory, the value of this attribute is a drive and subdirectory path (such as "C:/mySubDirectory") without a backslash ").
// Http://www.cnblogs.com/sosoft/
String str3 = Directory. GetCurrentDirectory (); // obtain the current working Directory of the application.
String str4 = AppDomain. CurrentDomain. BaseDirectory; // gets the base Directory, which is used by the Assembly conflict resolution program to detect the assembly.
String str5 = Application. StartupPath; // obtain the path of the executable file that started the Application, excluding the name of the executable file.
String str6 = Application. ExecutablePath; // obtain the path of the executable file that started the Application, including the name of the executable file.
String str7 = AppDomain. CurrentDomain. SetupInformation. ApplicationBase; // obtain or set the name of the directory containing the application.