G
Guest
I'm working on a system service application that is supposed to report various information about the computer it is running on back to a central server. One of the things I need to know is the username of the person who is currently logged on to the actual computer. I've tried using
Name = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();
However, since the service is owned by "System" I get "NT_AUTHORITY\SYSTEM" as a result. So how do I get the username of the person who is logged on instead of the name of the owner of the current process?
Thanks for any help,
Chris
Name = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();
However, since the service is owned by "System" I get "NT_AUTHORITY\SYSTEM" as a result. So how do I get the username of the person who is logged on instead of the name of the owner of the current process?
Thanks for any help,
Chris