【问题标题】:System.Security.Principal.WindowsIdentity.GetCurrent().Name Issue on ServerSystem.Security.Principal.WindowsIdentity.GetCurrent().Name 服务器上的问题
【发布时间】:2018-04-19 17:17:23
【问题描述】:

你知道我为什么用的时候:

System.Security.Principal.WindowsIdentity.GetCurrent().Name

在本地机器的.aspx.cs 页面上,它返回我的用户名,例如"CORP\323432",当我使用 IIS 在服务器上发布相同的代码时,它返回 IIS 和网站的名称?例如:"IIS SERVER\SITE"

【问题讨论】:

    标签: c# authentication visual-studio-2012 web-application-project


    【解决方案1】:

    这是因为这是实际运行 IIS 代码的用户名,所以如果您要为某事提供权限,您应该对这个用户或组执行此操作。看看这个:

    https://docs.microsoft.com/en-us/iis/get-started/planning-for-security/understanding-built-in-user-and-group-accounts-in-iis

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-27
      • 1970-01-01
      • 2011-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多