Use the System.Security.Principal namespace.
VB.NET
dim wp as WindowsPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent())
Response.Write(wp.Identity.Name)
C#
WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
Response.Write(wp.Identity.Name);
Share with