How to get the country code from CultureInfo?
System.Globalization.CultureInfo c = new System.Globalization.CultureInfo("en-GB");
var ri = new RegionInfo(c.Name);
string countryName = ri.DisplayName;
That will give you:
"United Kingdom"
For Two Letter Use:
string countryAbbrivation = ri.TwoLetterISORegionName;
That will give you "GB"
var c = new CultureInfo("en-GB");
var r = new RegionInfo(c.LCID);
string name = r.Name;
Most probably you need to use r.TwoLetterISORegionName
property.
string regionName = r.TwoLetterISORegionName;
You can try the RegionInfo Class. One of the properties is the RegionInfo.TwoLetterISORegionName Property. Example from MSDN:
RegionInfo myRI1 = new RegionInfo("US");
Console.WriteLine( " Name: {0}", myRI1.Name );
Console.WriteLine( " ThreeLetterISORegionName: {0}", myRI1.ThreeLetterISORegionName );
Console.WriteLine( " TwoLetterISORegionName: {0}", myRI1.TwoLetterISORegionName );
Name: US
ThreeLetterISORegionName: USA
TwoLetterISORegionName: US