开发者

Problem accessing Server variable in static function in C#

Im unable to access server/response varia开发者_运维问答ble in my static function. Can i access them in static function or should i include some namespaces


I'm having a really hard time understanding your question, but is it possible that you are looking for HttpContext.Current?

var context = HttpContext.Current;
// now you can use context.Request, context.Response, context.Server, etc.


System.Web.HttpContext.Current object includes current Server, Response, Request etc instances.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜