1.在IIS中将访问方式更改为不允许匿名访问
2.在Web.config中将验证方式更改为
   <identity impersonate="true"/>
   <authentication mode="Windows" />
3.在源代码中使用
string username= Security.Principal.WindowsIdentity.GetCurrent().Name
string[] info = username.Split(new char[1] { '\\' }, StringSplitOptions.RemoveEmptyEntries);
 
Domain:info[0]
Name: info[1]

相关文章:

  • 2021-06-18
  • 2021-12-17
  • 2022-12-23
  • 2021-11-28
  • 2022-03-01
  • 2022-12-23
  • 2021-10-18
猜你喜欢
  • 2021-09-01
  • 2021-08-22
  • 2022-03-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-06-26
相关资源
相似解决方案