【问题标题】:Get intranet authenticated user获取内网认证用户
【发布时间】:2014-04-29 20:00:00
【问题描述】:

我正在为我学校的 Intranet 构建一个 Web 应用程序。每当教师尝试访问浏览器以访问 Intranet 页面时,都会出现一个弹出窗口,以便他们可以登录,在我的页面中,我需要获取登录的用户名。你们有谁知道怎么做吗?

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

上面的代码是我到目前为止所做的,它获取了用户在 windows 上登录的用户名,但这并不是我真正想要的。

【问题讨论】:

    标签: c# asp.net authentication intranet


    【解决方案1】:

    您可以简单地使用以下语句:

    HttpContext.Current.User.Identity.Name
    

    【讨论】:

      猜你喜欢
      • 2017-10-25
      • 1970-01-01
      • 1970-01-01
      • 2013-07-06
      • 1970-01-01
      • 2015-01-06
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      相关资源
      最近更新 更多