Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
Remember getting the currently logged on widows user in VB6? well in .NET its a lot easier - No more API calls. Just use the security.Principal Namespace and the code : Syst
March 28, 2004
Remember getting the currently logged on widows user in VB6? well in .NET its a lot easier - No more API calls. Just use thesecurity.Principal Namespace and the code :
System.Security.Principal.WindowsIdentity.GetCurrent();
This returns a WindowsIdentity type object. From this object you can get a range of properties that could be useful. IsAuthenticated is another useful property that returns whether the current user has been authenticated by windows.
You May Also Like