免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
C#獲取項目程序路徑的方法
1.Asp.Net WebForm 用
“Request.PhysicalApplicationPath獲取站點所在虛擬目錄的物理路徑,最后包含“\”;

2.C# WinForm 用
A:“Application.StartupPath”:獲取當(dāng)前應(yīng)用程序所在目錄的路徑,最后不包含“\”;
B:“Application.ExecutablePath ”:獲取當(dāng)前應(yīng)用程序文件的路徑,包含文件的名稱;
C:“AppDomain.CurrentDomain.BaseDirectory”:獲取當(dāng)前應(yīng)用程序所在目錄的路徑,最后包含“\”;
D:“System.Threading.Thread.GetDomain().BaseDirectory”:獲取當(dāng)前應(yīng)用程序所在目錄的路徑,最后包含“\”;
E:“Environment.CurrentDirectory”:獲取當(dāng)前應(yīng)用程序的路徑,最后不包含“\”;
F:“System.IO.Directory.GetCurrentDirectory”:獲取當(dāng)前應(yīng)用程序的路徑,最后不包含“\”;

3.C# Windows Service
用“AppDomain.CurrentDomain.BaseDirectory”或“System.Threading.Thread.GetDomain().BaseDirectory”;
用“Environment.CurrentDirectory”和“System.IO.Directory.GetCurrentDirectory”將得到“ system32”目錄的路徑;
如果要使用“Application.StartupPath”或“Application.ExecutablePath ”,需要手動添加對“System.Windows.Forms.dll ”的引用,并在程序開頭用“using   System.Windows.Forms”聲明該引用;

4.在卸載程序獲取系統(tǒng)安裝的目錄
System.Reflection.Assembly curPath = System.Reflection.Assembly.GetExecutingAssembly();
string path=curPath.Location;//得到安裝程序類SetupLibrary文件的路徑,獲取這個文件路徑所在的目錄即得到安裝程序的目錄

http://blog.163.com/dykj_dxj/blog/static/254925252010830113424205/
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
獲取和設(shè)置c# 應(yīng)用程序目錄
C#獲取當(dāng)前路徑的7種方法
c#獲取當(dāng)前應(yīng)用程序所在路徑(轉(zhuǎn)) - CookBlack - 博客園
C# 獲取當(dāng)前路徑7種方法
C#中AppDomain.CurrentDomain.BaseDirectory與Appl...
獲取文件路徑
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服