Home
Manage Your Code
Snippet: How to Get Window NT Logged User Name Using ASP.NET (C#)
Title: How to Get Window NT Logged User Name Using ASP.NET Language: C#
Description: How to Get Window NT Logged User Name Using ASP.NET Views: 194
Author: Brendan Le Date Added: 9/28/2008
Copy Code  
11) System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;
2
3string strName = p.Identity.Name;
4
5[ OR ]
6
72) string strName = HttpContext.Current.User.Identity.Name.ToString();
8
9[ OR ]
10
113) string strName = Request.ServerVariables["AUTH_USER"]; //Finding with name

12
13string strName = Request.ServerVariables[5]; //Finding with index