I tried the following methods:
Request.ServerVariables["LOGON_USER"]
or
HttpContext.Current.User.Identity.Name
or
User.Identity.Name
- If I launched it using F5 from VS2010, it works fine.
- If I ran it in IIS (I tried it on 5.1 and 6.0, other IIS that I cannot use), there are empty lines.
In web.config, I have:
<authentication mode="Windows"/>
<authorization>
<allow users="*"/>
</authorization>
Therefore, all users must be authenticated.
Perhaps there should be more things in web.config.
I tried it in IE, Firefox and Chrome.
I post this question before, but there was some misleading information, so I submit it again.
source
share