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.
精彩评论