C#获取主程序目录的方法,目前本人知道的有以下几种:
1. System.Windows.Forms.Application.StartupPath
2. Environment.CurrentDirectory.ToString()
3. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
4. Directory.GetCurrentDirectory();
2. Environment.CurrentDirectory.ToString()
3. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
4. Directory.GetCurrentDirectory();
5. AppDomain.CurrentDomain.BaseDirectory