【发布时间】:2013-03-23 11:38:52
【问题描述】:
在我的 Web 应用程序中,我使用 System.Web.HttpContext.Current,它代表当前的命中上下文,我想知道它是如何从任何地方访问的,直到我注意到它是 static 成员!
虽然它是一个静态成员,但如果几乎同时收到两个请求,它如何保持其值。
像下面这样:
#Req1----> | set the value of the static field to req1
#Req2----> | set the value of the static field to req2
#Req1 | use that static its supposed to be req2 while its req1
我是否错过了某些东西,或者其中有什么技巧?
【问题讨论】:
标签: c# asp.net request static-members