none
Does .NET framework already have list of ISO country codes and etc? RRS feed

  • Question

  • Greetings i am developing a web application on ASP.NET MVC 5. since i am new with .net framework i was wondering if .net framework already has the list of items i need, and if it does what are the methods i can use?

    • ISO country code
    • ISO currency code
    • ISO locale code (language and country)
    • IATA Location List

    I've came across afew options, but i need the list of items above. if .NET Framework doesn't have it do i have create myself? or is there an api i can use for them? 

    Thursday, December 22, 2016 9:13 AM

Answers

  • I remember someone asked this question before.

    For the first three item there is RegionInfo class that you can use, but note that since this property calls GetLocaleInfoEx() etc. to get values, this function can only return country that the OS it's running on knows.

    For the last item you can store the list locally using information from here. There's nothing built-in .NET framework that I aware of.



    • Edited by cheong00Editor Friday, December 23, 2016 1:47 AM Replace the link to IATA with official source
    • Marked as answer by Valkyrie_ Wednesday, December 28, 2016 10:42 AM
    Friday, December 23, 2016 1:42 AM
    Answerer

All replies

  • I remember someone asked this question before.

    For the first three item there is RegionInfo class that you can use, but note that since this property calls GetLocaleInfoEx() etc. to get values, this function can only return country that the OS it's running on knows.

    For the last item you can store the list locally using information from here. There's nothing built-in .NET framework that I aware of.



    • Edited by cheong00Editor Friday, December 23, 2016 1:47 AM Replace the link to IATA with official source
    • Marked as answer by Valkyrie_ Wednesday, December 28, 2016 10:42 AM
    Friday, December 23, 2016 1:42 AM
    Answerer
  • Hi Valkyrie_,

    Here I also recommend you have a look at CultureInfo class. The information includes the names for the culture, the writing system, the calendar used, the sort order of strings, and formatting for dates and numbers.      

    Best regards,

    Kristin       


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Kristin Xie Friday, December 23, 2016 2:09 AM
    Friday, December 23, 2016 2:09 AM