HttpContext未null处理

1
2
3
4
5
6
7
8
9
10
11
12
13
public static HttpContext Current
 {
            get
            {
                if (instance.Value == null)
                {
                    instance = new ThreadLocal<HttpContext>(() => new HttpContext());
                }
                return (HttpContext)instance.Value;
            }
        }
  
protected static ThreadLocal<HttpContext> instance;

  

posted @   百小僧  阅读(615)  评论(1编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示