Current User

  • Thread starter Thread starter perspolis
  • Start date Start date
'Environment.UserName' will return the user name of the user who created the
current thread ina win forms app this would usually be the logged on user.


HTH

Ollie Riches
 
Persopolis
how can I get current user in windows by c#?

There are more options in my opinion the most easy one.

environment.username

I hope this helps?

Cor
 
Hi There

Try:

System.Security.Principal.WindowsIdentity.GetCurrent();
This returns a reference to a WindowsIdentity object representing the
current logged in user. You can use the Name property to get the login name
of the user.

Ben
 
Back
Top