ASP.NET Get data from AD about user
问题 Need to identify user on intranet site, windows user name is the goal. That will be appended to params going to SQL Server in the end. I can get HttpContext.Current.Request.ServerVariables("LOCAL_ADDR") 192.168.112.81 We have a mixed bag of addresses here, in that 33% are fixed and the rest are allocated. Is there a recourse to identify the user assigned to an IP within AD? If so do you have a link or an example? TIA. 回答1: Within a page, the username can be found with: Page.User.Identity.Name