Friday, June 27, 2014

How to Get Window NT Logged User Name Using ASP.NET



1) System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;
string strName = p.Identity.Name;


2) string strName = HttpContext.Current.User.Identity.Name.ToString();


3string strName = Request.ServerVariables["AUTH_USER"]; //Finding with name

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

No comments:

Post a Comment