How to obtain user name and domain name in .NET

If you are currently logged in Windows using your domain user name and password and you want to obtain your user name and domain name you can use Environment class as shown below:




About author

User avatar

Waqas Anwar

Founder of, Senior Consultant, Microsoft .NET and Web Technologies

Add Comment