Method 1:
Directory.GetCurrentDirectory ().
This method can only be used in. NET, the feature is not supported in NetCF, and an exception is thrown when it is called. Gets the current directory, which is not necessarily the true path, and is associated with the OpenFile dialog box. It is not recommended. Method 2:system.windows.forms.application.startuppath This method can only be used in. NET, the feature is not supported in NetCF, and an exception is thrown when it is called. Gets the path to run the program. Recommended Use
Method 3:
System.IO.Path.GetDirectoryName (assembly.getexecutingassembly (). GetName (). CodeBase).
This method is given in MSDN for the NETCF platform, when tested in the path obtained in the net full version of the PC, it is found that the final path with the file: prefix, such as file:\c:\debug, generally we do not need this prefix, can be manually removed.
Method 4:
System.IO.Path.GetDirectoryName (assembly.getexecutingassembly (). Manifestmodule.fullyqualifiedname).
This method is also for the solution given by NETCF, when consistent results can be obtained in the net full version of the PC test. Recommended Use
The directory path where C # gets the program