欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2023-11-18 16:57:58
非web程序 1.appdomain.currentdomain.basedirectory 2.environment.currentdirectory 3.httpru...
非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();