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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top