if your web application is with windows authentication, the easiest way should be: dim UserName as string = HttpContext.Current.User.Identity.Name.ToString()
if you want to use principal, have a look here: http://www.codeproject.com/KB/aspnet/How_to_NT_User_Name.aspx if you have matter in converting it (C# code) to VB: ----------------------------------------- dim p as System.Security.Principal.WindowsPrincipal=System.Threading.Thread.CurrentPrincipal dim UserName as string =p.Identity.Name [ OR ] 2) dim UserName as string = HttpContext.Current.User.Identity.Name.ToString() [ OR ] 3) dim UserName as string = Request.ServerVariables("AUTH_USER") '; //Finding with name 3b)dim UserName = Request.ServerVariables(5) '; //Finding with index In Above 3 Cases returnin string contains DomainName \WinNTLoggedUserName -----------------------------------------
