How To Get The User Name and Domain

username = string.Format(@"{0}\{1}", System.Environment.UserDomainName, 
System.Environment.UserName);

 

Tip Submitted By: David McCarter


Discover more from dotNetTips.com

Subscribe to get the latest posts sent to your email.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.