Software Development Network>> Windows Forms>> How get the account of the user who login the window
System.Security.Principal.
//Show user's informationuserIdentityTextBox.Text = currentUser.Name;
Hi,You can also use Environment.UserName property.Regards,-chris
How get the account of the user who login the window
tikki
You can get this property :
System.Security.Principal.
WindowsIdentity currentUser = System.Security.Principal.WindowsIdentity.GetCurrent();//Show user's information
userIdentityTextBox.Text = currentUser.Name;
DIII
That's a very very bad idea as the process starting your app can override the environment tricking your application into thinking somebody else is using it.
dundret
Hi,
You can also use Environment.UserName property.
Regards,
-chris
stefandemetz