C# 取得程序路径

来源:互联网 发布:windows 经典样式 编辑:程序博客网 时间:2024/04/29 22:47

 Web应用程序: Request.MapPath(Request.ApplicationPath)

Winform应用程序: 以C:/Temp/Test.exe为例

Application.ExecutablePath

Application.StartupPath
程序结果如下:

C:/Temp/Test.exe
C:/Temp