PDA

Click to See Complete Forum and Search --> : Language ID / Country Info


sunburnt
Feb 24th, 2004, 06:49 PM
This is a really minor problem, but it's nagging at me.
Is it possible to get the Language ID / Country Abbreviation / Country Name without using interop? Peeking around in the Globalization namespace I noticed I can get the LCID:
System.Globalization.CultureInfo.CurrentCulture.LCID


however, the CurrentCulture doesn't seem to contain any reference to the country, except in the Language fields ("en-US", "English (United States)") and I'd rather not parse these.

I realize I could just use interop, but I'm looking for a completely managed solution.

Any sugguestions?


The API calls I'm looking to duplicate are:
dwLCID = // the LCID. :P
dwLangID = GetUserDefaultLangID()
GetLocaleInfo(dwLCID, LOCALE_SABBREVCTRYNAME, szLocaleBuffer, sizeof(szLocaleBuffer));
GetLocaleInfo(dwLCID, LOCALE_SENGCOUNTRY, szLocaleBuffer2, sizeof(szLocaleBuffer2));