How to determine the Windows User from a Web form Application

Platform: ASP.NET| Category: Security

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

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.