开发者

How can I access the HttpServerUtility instance in ASP.NET MVC controller?

Ho开发者_StackOverfloww can I access the HttpServerUtility instance in ASP.NET MVC controller?


"this.httpContext.Server" is a reference to HttpServerUtilityBase, the abstract class wrapper that's a part of the System.Web.Abstractions DLL. You can also do:

HttpContext.Current.Server

To directly access the "old-school" way. Also you can get an instance of the base class using the wrapper by doing the following:

new HttpServerUtilityWrapper(HttpContext.Current.Server)

The wrapper class inherits from httpServerUtilityBase

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜