使用ASP.NET获得AD帐号 “域\用户名”
1.在IIS中将访问方式更改为不允许匿名访问
2.在Web.config中将验证方式更改为
<identity impersonate="true"/>
<authentication mode="Windows" />
3.在源代码中使用
var1 = Security.Principal.WindowsIdentity.GetCurrent.Name
1.在IIS中将访问方式更改为不允许匿名访问
2.在Web.config中将验证方式更改为
<identity impersonate="true"/>
<authentication mode="Windows" />
3.在源代码中使用
var1 = Security.Principal.WindowsIdentity.GetCurrent.Name
转载于:https://www.cnblogs.com/shaofh/archive/2007/06/12/781057.html