Get the username of the user accessing ASP.NET intranet page within local network

前端 未结 5 748
遇见更好的自我
遇见更好的自我 2021-01-01 05:25

We have an ASP.NET intranet site, available to users who are either physically at and logged into a local machine or else to users who connect remotely via VPN. Is there a

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-01 06:18

    If the authentication is windows, this should help:

    IIdentity WinId= HttpContext.Current.User.Identity;
    WindowsIdentity wi = (WindowsIdentity)WinId;
    

提交回复
热议问题