How to get current widows loging name and user domain name in C#

If you need to retrieve the user name & domain of the logged-in user in your C# application , you can access it in a following simples steps..



Step 01 : Open Visual Studio 2008 and start new WindowsFormApplication

Step 02 : Design following form ( add lables from tool box )

Step 03 : Doubble click on the form and add following code in side the Form load event



Step 04 : Then Build ( Press F6 ) and run program ( Press F5 )

Thank you all...

Categories:

Leave a Reply