分享到: 百度 更多

C#中经常用来获得路径方法和属性

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

posted @ 2012-08-06 00:34  黑马_Summer  阅读(191)  评论(0编辑  收藏  举报
分享到: 百度 更多