如何取得.Net应用程序本身的路径

转载自疾风萧萧

1、System.AppDomain.CurrentDomain.BaseDirectory, Gets the base directory that the assembly resolver used to probe for assemblies.

2、System.Windows.Forms.Application.ExecutablePath, Gets the path for the executable file that started the application, including the executable name.

3、System.Windows.Forms.Application.StartupPath, Gets the path for the executable file that started the application, not including the executable name.

4、System.Environment.CurrentDirectory, Gets and sets the fully qualified path of the current directory; that is, the directory from which this process starts. By definition, if this process starts in the root directory of a local or network drive, the value of this property is the drive name followed by a trailing slash (for example, "C:\"). If this process starts in a subdirectory, the value of this property is the drive and subdirectory path, without a trailing slash (for example, "C:\mySubDirectory").

你可能感兴趣的:(.net)