首页 > 编程 > C# > 正文

C#取得Web程序和非Web程序的根目录的N种取法总结

2020-01-24 03:47:45
字体:
来源:转载
供稿:网友
非Web程序

1.AppDomain.CurrentDomain.BaseDirectory

2.Environment.CurrentDirectory

3.HttpRuntime.BinDirectory

The path to the current application's/bin directory.


Web程序

HttpCurrent.Context.Server.Mappath();
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表