GET THE LOGIN SYSTEM USER NAME USING C#

Ashish Pandey

Total Post:128

Points:898
Posted by  Ashish Pandey
C# 
C#
 2894  View(s)
Ratings:
Rate this:

How to get our system user name using C#

  1. Jeet Verma

    Post:110

    Points:776
    Re: Get the Login System User name using C#

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!