Results 1 to 1 of 1

Thread: Language ID / Country Info

Threaded View

  1. #1

    Thread Starter
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403

    Language ID / Country Info

    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:
    Code:
    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));
    Last edited by sunburnt; Feb 24th, 2004 at 07:57 PM.
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width