得到窗体身份验证的用户名 [英] Get the username in Forms authentication
本文介绍了得到窗体身份验证的用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Forms身份验证。
I'm using Forms authentication.
在Windows身份验证获得PC我使用的用户名: User.Identity.Name
In Windows Authentication for get the user name of the PC i use: User.Identity.Name
我还需要在窗体身份验证此信息,但 User.Identity.Name
不起作用。
I need this information also in Forms authentication but User.Identity.Name
doesn't work.
如何获得User.Identity.Name不使用Windows身份验证?
How can I get the User.Identity.Name without using Windows authentication?
推荐答案
要获得认证的用户的用户名:
To get the UserName of the authenticated user:
HttpContext.Current.User.Identity.Name;
这篇关于得到窗体身份验证的用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文