ASP.NET中Request.IsAuthenticated和Request.User.Identity.IsAuthenticated的区别
生活随笔
收集整理的這篇文章主要介紹了
ASP.NET中Request.IsAuthenticated和Request.User.Identity.IsAuthenticated的区别
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
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);} }所以說這兩者應(yīng)該是沒區(qū)別的,不過因?yàn)榧恿艘恍┡袛嗟囊蛩?#xff0c;看來使用 Request.IsAuthenticated 會(huì)保險(xiǎn)一點(diǎn)。
?
轉(zhuǎn)載于:https://www.cnblogs.com/rulee/archive/2012/05/04/2482495.html
總結(jié)
以上是生活随笔為你收集整理的ASP.NET中Request.IsAuthenticated和Request.User.Identity.IsAuthenticated的区别的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 丁小平:人类究竟需要什么样的微积分原理
- 下一篇: asp.net 使用Master模板页需