WindowsIdentity identity = WindowsIdentity.GetCurrent();
string userName = identity.Name;
注:webconfig配置为<authentication mode="Windows"/>
IIS身份验证为Windows身份验证
WindowsIdentity identity = WindowsIdentity.GetCurrent();
string userName = identity.Name;
注:webconfig配置为<authentication mode="Windows"/>
IIS身份验证为Windows身份验证