码迷,mamicode.com
首页 > Web开发 > 详细

Thread.CurrentPrincipal & HttpContext.Current.User

时间:2014-10-22 12:20:42      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:style   http   color   strong   sp   on   ad   new   size   

据说要这样写才稳妥

// This principal will flow throughout the request.
VoyagerPrincipal principal = new VoyagerPrincipal(yada, yada, yada);

// Attach the new principal object to the current HttpContext object
HttpContext.Current.User = principal;

// Make sure the Principal is in sync
System.Threading.Thread.CurrentPrincipal = System.Web.HttpContext.Current.User;

Thread.CurrentPrincipal & HttpContext.Current.User

标签:style   http   color   strong   sp   on   ad   new   size   

原文地址:http://www.cnblogs.com/teamleader/p/4042606.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!