1  1 // 获取程序的基目录。
2 2 System.AppDomain.CurrentDomain.BaseDirectory
3 3
4 4
5 5 // 获取模块的完整路径。
6 6 System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
7 7
8 8
9 9 // 获取和设置当前目录(该进程从中启动的目录)的完全限定目录。
10 10 System.Environment.CurrentDirectory
11 11
12 12
13 13 // 获取应用程序的当前工作目录。
14 14 System.IO.Directory.GetCurrentDirectory()
15 15
16 16
17 17 // 获取和设置包括该应用程序的目录的名称。
18 18 System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase
19 19
20 20
21 21 // 获取启动了应用程序的可执行文件的路径。
22 22 System.Windows.Forms.Application.StartupPath
23 23
24 24
25 25 // 获取启动了应用程序的可执行文件的路径及文件名
26 26 System.Windows.Forms.Application.ExecutablePath

相关文章:

  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-04
  • 2021-10-21
  • 2021-12-23
相关资源
相似解决方案