C#、获取当前目录

来源:互联网 发布:类似tinder的软件 编辑:程序博客网 时间:2024/05/07 10:11
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;

示例:X:\Codes\App\bin\Debug\App.vshost.exe

System.Environment.CurrentDirectory;
示例:X:\Codes\App\bin\Debug

System.IO.Directory.GetCurrentDirectory();
示例:X:\Codes\App\bin\Debug

System.AppDomain.CurrentDomain.BaseDirectory;
示例:X:\Codes\App\bin\Debug\

System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
示例:X:\Codes\App\bin\Debug\

System.Windows.Forms.Application.StartupPath;
示例:X:\Codes\App\bin\Debug

System.Windows.Forms.Application.ExecutablePath;
示例:X:\Codes\App\bin\Debug\App.EXE



原创粉丝点击