vs2017 Windows用户获取域名登录

WindowsIdentity identity = WindowsIdentity.GetCurrent();
string userName = identity.Name;

注:webconfig配置为<authentication mode="Windows"/>

  IIS身份验证为Windows身份验证

猜你喜欢

转载自www.cnblogs.com/yaiy/p/12167424.html