首页 > Web开发 > 详细

Thread.CurrentPrincipal & HttpContext.Current.User

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

据说要这样写才稳妥

// 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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!