0

Web.config ファイル

<authentication mode="Windows" />     

<authorization>
  <allow users ="*" />
</authorization>

IIS のアクセス許可

(Unchecked)Enable ananymouse access
(Checked)Integrated windows authentication

C#コード、

welcomeUser.InnerText = Request.ServerVariables.Get("LOGON USER");

Windows User ID を表示できるようにするために何が欠けていますか?

4

1 に答える 1

0

I think the variable is LOGON_USER isn't it? (With underscore) See here

You may find that this gives you IUSR_MachineName though, so you might want to look up better ways of finding the actual logged in user, such as User.Identity.Name or by using WindowsIdentity.GetCurrent().Name;

于 2012-02-28T11:47:19.273 に答える