views:

38

answers:

2

I have a little application I build that monitors tickets submitted. It basically just sits there in the corner and notifies when new tickets arrive. I need to get the persons username who is logged into the computer to pull their tickets.

I tried searching, but I think I'm using the wrong terminology as I couldn't really find anything.

+2  A: 

Try System.Security.Principal.WindowsIdentity.GetCurrent().Name

Jouke van der Maas
This worked, but the Environment.Username worked a little better as I didn't have to strip out the domain.
Jhorra
Fair enough, i forgot what that was and was to lazy too look it up. I just googled and found this.
Jouke van der Maas
+2  A: 

You're looking for the Environment.UserName property.

You may also be looking for the Environment.UserDomainName property.

SLaks