获取用户名 asp.net windows auth [英] get user name asp.net windows auth
问题描述
所以我制作了一个简单的网页表单,在 iis 中的 windows auth 中设置.然后我将它部署在我的服务器上并尝试登录.它提示我一个登录框,我输入我的信息,看起来它在活动目录中工作正常.
SO i made a simple web form, set in windows auth in iis. then i deployed it on my server and i try to log in. it prompts me a login box, i enter my infos, looks likes its working fine with active directory.
如果我输入错误,它将无法工作等
if i enter something wrong it wont work etc.
显然我需要知道谁是登录用户
obviously i need to know who is the logged on user
Response.Write(HttpContext.Current.User.Identity.Name.ToString());
我在其他线程中发现了这个,但它对我不起作用...
i found this in other threads, but it wont work for me...
如何获取登录框中填写的信息?
how do i get the info filled in the login box ?
推荐答案
in web config ,解决了我的问题.
http://msdn.microsoft.com/en-us/library/ff647076.aspx帮助了我.
谢谢.
<identity impersonate="true" />
in web config , fixed my problem.
http://msdn.microsoft.com/en-us/library/ff647076.aspx helped me.
thanks.
这篇关于获取用户名 asp.net windows auth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!