Finding the computer's country of use

Answered Finding the computer's country of use

  • vendredi 15 avril 2005 00:40
     
     
    Hi,

    I want to find the location of the computer a C# Windows Application is being used on and put it into a String. It could also be the country chosen when Windows 2000, or XP was installed.

    I then need to filter down my city list (combobox) from my DB to suit the country.

    By my understanding it can either be found in the Windows registry or by some sort of C# .NET system variable.

    Any comments will be much appreciated.

    Best Regards,

    Dean Krause

Toutes les réponses

  • vendredi 15 avril 2005 05:41
    Modérateur
     
     Traitée

    System.Globalization.RegionInfo.CurrentRegion.EnglishName will display the english name of the country set in Control Panel... Regional and Language Options.

    If you need the localized name rather than the english name, you can retrieve it from System.Globalization.RegionInfo.CurrentRegion.DisplayName.