'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.
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.
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.