當(dāng)前位置:
首頁(yè) >
【转】C#获取当前路径7种方法
發(fā)布時(shí)間:2024/4/17
48
豆豆
生活随笔
收集整理的這篇文章主要介紹了
【转】C#获取当前路径7种方法
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
webform
var s = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; //C盤 IIS路徑 var s1 = System.Environment.CurrentDirectory; //同上 var s2 = System.IO.Directory.GetCurrentDirectory();//同上 var s3 = System.AppDomain.CurrentDomain.BaseDirectory; //當(dāng)前項(xiàng)目根目錄 var s4 = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase; //同上
var s = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; //C盤 IIS路徑 var s1 = System.Environment.CurrentDirectory; //同上 var s2 = System.IO.Directory.GetCurrentDirectory();//同上 var s3 = System.AppDomain.CurrentDomain.BaseDirectory; //當(dāng)前項(xiàng)目根目錄 var s4 = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase; //同上
winformSystem.Windows.Forms.Application.StartupPath System.Windows.Forms.Application.ExecutablePath
?
轉(zhuǎn)載于:https://www.cnblogs.com/wdw31210/p/4304987.html
總結(jié)
以上是生活随笔為你收集整理的【转】C#获取当前路径7种方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 开源协议
- 下一篇: C# Lambda表达式 基础