まさにタイトル通り。asp.net ページ内からの Windows ログオンとドメイン情報が必要です。
私は試した
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
ただし、ユーザー名ではなくIISアプリケーションプールを返します
ありがとう
まさにタイトル通り。asp.net ページ内からの Windows ログオンとドメイン情報が必要です。
私は試した
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
ただし、ユーザー名ではなくIISアプリケーションプールを返します
ありがとう
これはVB.netの私のコードです
var strUser = System.Web.HttpContext.Current.User.Identity.Name
そのため、C# は次の行にある必要があります: (テストされていません) string strUser = System.Web.HttpContext.Current.User.Identity.Name;
Web.Config ファイル内
<configuration>
<system.web>
<authentication mode="Windows"/>
<identity impersonate="true" />
</system.web>
</configuration>