如何获得国家的国籍asp.net c#

时间:2015-10-11 05:11:02

标签: c# asp.net

我想要一个国家的国籍。如果我输入英格兰,那么它将返回英格兰的国籍。我不知道cultureinfo是否帮助了我。

string country = "England";

输出应该是:英国

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

        //Init your dictonary as like this
        Dictionary<string, string> countryNationality = new Dictionary<string, string>() { { "India", "Indian" }, { "England", "British" } };
        // Now access the value like this 
        string nationality = countryNationality["England"];//will give you British
        string anotherNationality = countryNationality["India"];//will give you British