Web.config文件
<authentication mode="Windows" />
<authorization>
<allow users ="*" />
</authorization>IIS权限
(Unchecked)Enable ananymouse access
(Checked)Integrated windows authenticationC#代码,
welcomeUser.InnerText = Request.ServerVariables.Get("LOGON USER");我遗漏了什么才能显示Windows用户ID?
发布于 2012-02-28 11:47:19
我想变量是LOGON_USER对吧?(带下划线)参见这里
您可能会发现这给了您IUSR_MachineName,因此您可能希望查找更好的方法来查找实际登录用户,例如User.Identity.Name或使用WindowsIdentity.GetCurrent().Name;。
https://stackoverflow.com/questions/9481224
复制相似问题