C # Relative Path and System Path
// Obtain the path of the executable file that started the application, excluding the name of the executable file. String str5 = application. startuppath; // Obtain the file name of the currently executed exe. String str1 = process. getcurrentprocess (). mainmodule. filename; // Obtain and set the full path of the current directory (that is, the directory from which the process starts. The remarks are as defined. if the process is started locally or in the root directory of the network drive, the value of this attribute is the drive name followed by a backslash (for example, "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 "). String str2 = environment. currentdirectory; // Obtain the current working directory of the application. String str3 = directory. getcurrentdirectory (); // Obtain the base Directory, which is used by the Assembly conflict resolution program to detect the assembly. String str4 = appdomain. currentdomain. basedirectory; // Obtain the path of the executable file that started the application, excluding the name of the executable file. String str5 = application. startuppath; // Obtain the path of the executable file that started the application, including the name of the executable file. String str6 = application. executablepath; // Obtain or set the name of the directory containing the application. String str7 = appdomain. currentdomain. setupinformation. applicationbase |