ASP.NET中Request.IsAuthenticated和Request.User.Identity.IsAuthenticated的区别
生活随笔
收集整理的這篇文章主要介紹了
ASP.NET中Request.IsAuthenticated和Request.User.Identity.IsAuthenticated的区别
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Reflector 查看 System.Web.dll 中 HttpRequest.cs 的代碼:
public bool IsAuthenticated {get{return (((this._context.User != null) && (this._context.User.Identity != null)) && this._context.User.Identity.IsAuthenticated);} }所以說這兩者應該是沒區別的,不過因為加了一些判斷的因素,看來使用 Request.IsAuthenticated 會保險一點。
?
轉載于:https://www.cnblogs.com/rulee/archive/2012/05/04/2482495.html
總結
以上是生活随笔為你收集整理的ASP.NET中Request.IsAuthenticated和Request.User.Identity.IsAuthenticated的区别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 丁小平:人类究竟需要什么样的微积分原理
- 下一篇: 可视化webpart基础开发——Tree