<分区>
Possible Duplicate:
difference between http.context.user and thread.currentprincipal and when to use them?
这两者在 ASP.NET 应用程序中有什么区别?
我知道 HttpContext.User.Identity
是在用户通过 FormsAuthentication
进行身份验证时设置的。但是 Thread.CurrentPrincipal.Identity
何时设置?
它们是否始终保持相同的值?
对于无法访问 HttpContext
的应用程序的其他层,这是否仍然适用?