I really don't understand how a class like HttpContext.Current
is visible (for t开发者_运维技巧he single request) to the whole web application, without be "static".
Which kind of treatment .NET do for that class?
In class HttpContext, Current is static property
public static HttpContext Current { get; set; }
More information see: http://msdn.microsoft.com/en-us/library/system.web.httpcontext.current.aspx
It is what is called a Singleton design pattern.
Here's a good explanation of the Singleton pattern with examples in C#
精彩评论