Get C# various running directories

// Get the base directory of the program.  
System.AppDomain.CurrentDomain.BaseDirectory

// Get the full path to the module.
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName

// Gets and sets the fully qualified directory of the current directory (the directory from which this process was started). System.Environment.CurrentDirectory

// Get the current working directory of the application.
System.IO.Directory.GetCurrentDirectory()

// Gets and sets the name of the directory that contains the application.
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase

// Get the path to the executable that launched the application.
 System.Windows.Forms.Application.StartupPath

// Get the path and filename of the executable file that started the application. 
System.Windows.Forms.Application.ExecutablePath

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325964699&siteId=291194637