title: In C#, how to get the "Country or region" selected under "Region & language" in Windows 10?
body: <p>I am running Windows 10. When I open "Region &amp; language settings" from the start menu, I can select a "Country or region". I am trying to get this value in a C# program. </p>
  
  <p>I am in Denmark. I have tried changing my country to Germany (see <a href="https://i.stack.imgur.com/AYavI.png" rel="nofollow noreferrer">screenshot</a>), but I cannot get my code to return Germany. Rebooting the computer did not help.</p>
  
  <p>I have written some code inspired by <a href="https://stackoverflow.com/questions/1542409/how-to-get-current-regional-settings-in-c">this thread</a>.</p>
  
  <p>My code looks like this (trying various things at once, getting all the region/culture things I can think of):</p>
  
  <pre><code>private static void Main(string[] args)
  {
      Thread.CurrentThread.CurrentCulture.ClearCachedData();
      Thread.CurrentThread.CurrentUICulture.ClearCachedData();
      var thread = new Thread(() =&gt; ((Action) (() =&gt;
      {
          Console.WriteLine("Current culture: {0}", Thread.CurrentThread.CurrentCulture.Name);
          Console.WriteLine("Current UI culture: {0}", Thread.CurrentThread.CurrentUICulture.Name);
          Console.WriteLine("Installed UI culture: {0}", CultureInfo.InstalledUICulture.Name);
          Console.WriteLine("Current region: {0}", RegionInfo.CurrentRegion.ThreeLetterISORegionName);
          Console.WriteLine("System default LCID: {0}", GetSystemDefaultLCID());
      }))());
      thread.Start();
      thread.Join();
      Console.ReadKey();
  }
  
  [DllImport("kernel32.dll")]
  private static extern uint GetSystemDefaultLCID();
  </code></pre>
  
  <p>It outputs:</p>
  
  <pre><code>Current culture: en-DK
  Current UI culture: en-US
  Installed UI culture: en-US
  Current region: DNK
  System default LCID: 1033
  </code></pre>
  
  <p>How can I get my program to detect that I have selected Germany? What method or property do I need to call? And what restarts or cache-clearing might be necessary?</p>