user name

kcwallace

Centurion
Joined
May 27, 2004
Messages
175
Location
Austin, TX
I need to determine a users network user name from within a C# winForm.

I have the VB equivalent:

Visual Basic:
Dim NetName As String = My.User.Name
 
C#:
System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent();
Console.WriteLine(identity.Name);
 
Back
Top