Get the Login System User name using C#

Total Post:128

Points:898

C# 
C#
 3582  View(s)
Ratings:
Rate this:

How to get our system user name using C#

  1. 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

      Modified On Mar-31-2018 06:38:44 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.