且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

asp.net中, 如何在后台获取访问这个页面的用户的名字?

更新时间:2022-08-15 22:09:22

asp.net中, 如何在后台获取访问这个页面的用户的名字?
在集成安全认证下可以利用以下代码获取:
System.Security.Principal.WindowsIdentity wi = (System.Security.Principal.WindowsIdentity)System.Web.HttpContext.Current.User.Identity.Name;
或者直接用:
System.Web.HttpContext.Current.User.Identity.Name;












本文转自terryli51CTO博客,原文链接:http://blog.51cto.com/terryli/519590 ,如需转载请自行联系原作者