Home > DeveloperSection > Forums > Get the Login System User name using C#
Ashish Pandey

Total Post:128

Points:898
Posted on    October-07-2013 8:50 AM

 C# C# 
Ratings:


 1 Reply(s)
 2280  View(s)
Rate this:

How to get our system user name using C#



Jeet Verma
Jeet Verma

Total Post:110

Points:776
Posted on    October-08-2013 12:57 AM

You Should use for getting  the Login System User name using C#

RegistryKey processor_key = Registry.CurrentUser.OpenSubKey(@"Volatile Environment");

            if (processor_key != null)

            {

                if (processor_key.GetValue("USERNAME") != null)

                    Console.WriteLine("Language: {0}", processor_key.GetValue("USERNAME").ToString());

            }

Note: - You need to Microsoft.Win32 namespace for RegistryKey


Don't want to miss updates? Please click the below button!

Follow MindStick