文章出處
文章列表
1.System.Reflection.Assembly.GetExecutingAssembly().Location
獲取當前工程,比如DLL或者應用程序的目錄。因為程序調用的DLL,有可能在任意一個文件夾,這方法能獲取當前調用的DLL對應的路徑。
2.Application.Current.StartupUri和Application.StartupPath
都是獲取程序啟動路徑,區別是基類System.Windows和System.Windows.Forms
3.System.AppDomain.CurrentDomain.BaseDirectory
獲取程序的基目錄
以上是個人常用到的路徑,完整的路徑獲取,可以參考其它博客:
http://www.cnblogs.com/netlyf/archive/2011/06/22/2086718.html
文章列表
全站熱搜