有没有人知道一个很好的,可用的类,这里的每个人都可以从中填充ComboBox国家和州字段的表单上的控件?
我讨厌每次都要重新发明轮子,有人可能在某个地方完成了一项非常好的工作.
如果现有类可以在选择国家/地区时返回状态选项列表,则可获得奖励积分!
我目前正在为Windows窗体(非Web应用程序)开发此项目,并且此项目无法从网站上获取.
jp2*_*ode 28
好的,所以我做了一个.
我构建它很好,通用,所以任何人都应该能够使用它
底部有一个类被调用US_States,用作存储状态名和状态缩写的容器.
static class StateArray {
static List<US_State> states;
static StateArray() {
states = new List<US_State>(50);
states.Add(new US_State("AL", "Alabama"));
states.Add(new US_State("AK", "Alaska"));
states.Add(new US_State("AZ", "Arizona"));
states.Add(new US_State("AR", "Arkansas"));
states.Add(new US_State("CA", "California"));
states.Add(new US_State("CO", "Colorado"));
states.Add(new US_State("CT", "Connecticut"));
states.Add(new US_State("DE", "Delaware"));
states.Add(new US_State("DC", "District Of Columbia"));
states.Add(new US_State("FL", "Florida"));
states.Add(new US_State("GA", "Georgia"));
states.Add(new US_State("HI", "Hawaii"));
states.Add(new US_State("ID", "Idaho"));
states.Add(new US_State("IL", "Illinois"));
states.Add(new US_State("IN", "Indiana"));
states.Add(new US_State("IA", "Iowa"));
states.Add(new US_State("KS", "Kansas"));
states.Add(new US_State("KY", "Kentucky"));
states.Add(new US_State("LA", "Louisiana"));
states.Add(new US_State("ME", "Maine"));
states.Add(new US_State("MD", "Maryland"));
states.Add(new US_State("MA", "Massachusetts"));
states.Add(new US_State("MI", "Michigan"));
states.Add(new US_State("MN", "Minnesota"));
states.Add(new US_State("MS", "Mississippi"));
states.Add(new US_State("MO", "Missouri"));
states.Add(new US_State("MT", "Montana"));
states.Add(new US_State("NE", "Nebraska"));
states.Add(new US_State("NV", "Nevada"));
states.Add(new US_State("NH", "New Hampshire"));
states.Add(new US_State("NJ", "New Jersey"));
states.Add(new US_State("NM", "New Mexico"));
states.Add(new US_State("NY", "New York"));
states.Add(new US_State("NC", "North Carolina"));
states.Add(new US_State("ND", "North Dakota"));
states.Add(new US_State("OH", "Ohio"));
states.Add(new US_State("OK", "Oklahoma"));
states.Add(new US_State("OR", "Oregon"));
states.Add(new US_State("PA", "Pennsylvania"));
states.Add(new US_State("RI", "Rhode Island"));
states.Add(new US_State("SC", "South Carolina"));
states.Add(new US_State("SD", "South Dakota"));
states.Add(new US_State("TN", "Tennessee"));
states.Add(new US_State("TX", "Texas"));
states.Add(new US_State("UT", "Utah"));
states.Add(new US_State("VT", "Vermont"));
states.Add(new US_State("VA", "Virginia"));
states.Add(new US_State("WA", "Washington"));
states.Add(new US_State("WV", "West Virginia"));
states.Add(new US_State("WI", "Wisconsin"));
states.Add(new US_State("WY", "Wyoming"));
}
public static string[] Abbreviations() {
List<string> abbrevList = new List<string>(states.Count);
foreach (var state in states) {
abbrevList.Add(state.Abbreviations);
}
return abbrevList.ToArray();
}
public static string[] Names() {
List<string> nameList = new List<string>(states.Count);
foreach (var state in states) {
nameList.Add(state.Name);
}
return nameList.ToArray();
}
public static US_State[] States() {
return states.ToArray();
}
}
class US_State {
public US_State() {
Name = null;
Abbreviations = null;
}
public US_State(string ab, string name) {
Name = name;
Abbreviations = ab;
}
public string Name { get; set; }
public string Abbreviations { get; set; }
public override string ToString() {
return string.Format("{0} - {1}", Abbreviations, Name);
}
}
Run Code Online (Sandbox Code Playgroud)
sob*_*ito 10
更新了jp2codes示例,并添加了加拿大:
public static class States {
public static List<State> los = new List<State> {
//us
new State("AL", "Alabama"),
new State("AK", "Alaska"),
new State("AZ", "Arizona"),
new State("AR", "Arkansas"),
new State("CA", "California"),
new State("CO", "Colorado"),
new State("CT", "Connecticut"),
new State("DE", "Delaware"),
new State("DC", "District Of Columbia"),
new State("FL", "Florida"),
new State("GA", "Georgia"),
new State("HI", "Hawaii"),
new State("ID", "Idaho"),
new State("IL", "Illinois"),
new State("IN", "Indiana"),
new State("IA", "Iowa"),
new State("KS", "Kansas"),
new State("KY", "Kentucky"),
new State("LA", "Louisiana"),
new State("ME", "Maine"),
new State("MD", "Maryland"),
new State("MA", "Massachusetts"),
new State("MI", "Michigan"),
new State("MN", "Minnesota"),
new State("MS", "Mississippi"),
new State("MO", "Missouri"),
new State("MT", "Montana"),
new State("NE", "Nebraska"),
new State("NV", "Nevada"),
new State("NH", "New Hampshire"),
new State("NJ", "New Jersey"),
new State("NM", "New Mexico"),
new State("NY", "New York"),
new State("NC", "North Carolina"),
new State("ND", "North Dakota"),
new State("OH", "Ohio"),
new State("OK", "Oklahoma"),
new State("OR", "Oregon"),
new State("PA", "Pennsylvania"),
new State("RI", "Rhode Island"),
new State("SC", "South Carolina"),
new State("SD", "South Dakota"),
new State("TN", "Tennessee"),
new State("TX", "Texas"),
new State("UT", "Utah"),
new State("VT", "Vermont"),
new State("VA", "Virginia"),
new State("WA", "Washington"),
new State("WV", "West Virginia"),
new State("WI", "Wisconsin"),
new State("WY", "Wyoming"),
//canada
new State("AB", "Alberta"),
new State("BC", "British Columbia"),
new State("MB", "Manitoba"),
new State("NB", "New Brunswick"),
new State("NL", "Newfoundland and Labrador"),
new State("NS", "Nova Scotia"),
new State("NT", "Northwest Territories"),
new State("NU", "Nunavut"),
new State("ON", "Ontario"),
new State("PE", "Prince Edward Island"),
new State("QC", "Quebec"),
new State("SK", "Saskatchewan"),
new State("YT", "Yukon"),
};
public static List<string> Abbreviations() {
return los.Select(s => s.Abbreviation).ToList();
}
public static List<string> Names() {
return los.Select(s => s.Name).ToList();
}
public static string GetName(string abbreviation) {
return los.Where(s => s.Abbreviation.Equals(abbreviation, StringComparison.CurrentCultureIgnoreCase)).Select(s => s.Name).FirstOrDefault();
}
public static string GetAbbreviation(string name) {
return los.Where(s => s.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)).Select(s => s.Abbreviation).FirstOrDefault();
}
public static List<State> ToList() {
return los;
}
}
public class State {
public State(string ab, string name) {
Name = name;
Abbreviation = ab;
}
public string Name { get; set; }
public string Abbreviation { get; set; }
public override string ToString() {
return string.Format("{0} - {1}", Abbreviation, Name);
}
}
Run Code Online (Sandbox Code Playgroud)
public partial class State
{
public string Name { get; set; }
public string Abbreviations { get; set; }
}
/// <summary>
/// Return a static list of all U.S. states
/// </summary>
/// <returns></returns>
public IEnumerable<State> ListOfStates()
{
var states = CreateStateList();
return states.ToList();
}
private static IList<State> CreateStateList()
{
List<State> states = new List<State>();
states.Add(new State() { Abbreviations = "AL", Name = "Alabama" });
states.Add(new State() { Abbreviations = "AK", Name = "Alaska" });
states.Add(new State() { Abbreviations = "AR", Name = "Arkansas" });
states.Add(new State() { Abbreviations = "AZ", Name = "Arizona" });
states.Add(new State() { Abbreviations = "CA", Name = "California" });
states.Add(new State() { Abbreviations = "CO", Name = "Colorado" });
states.Add(new State() { Abbreviations = "CT", Name = "Connecticut" });
states.Add(new State() { Abbreviations = "DC", Name = "District of Columbia" });
states.Add(new State() { Abbreviations = "DE", Name = "Delaware" });
states.Add(new State() { Abbreviations = "FL", Name = "Florida" });
states.Add(new State() { Abbreviations = "GA", Name = "Georgia" });
states.Add(new State() { Abbreviations = "HI", Name = "Hawaii" });
states.Add(new State() { Abbreviations = "ID", Name = "Idaho" });
states.Add(new State() { Abbreviations = "IL", Name = "Illinois" });
states.Add(new State() { Abbreviations = "IN", Name = "Indiana" });
states.Add(new State() { Abbreviations = "IA", Name = "Iowa" });
states.Add(new State() { Abbreviations = "KS", Name = "Kansas" });
states.Add(new State() { Abbreviations = "KY", Name = "Kentucky" });
states.Add(new State() { Abbreviations = "LA", Name = "Louisiana" });
states.Add(new State() { Abbreviations = "ME", Name = "Maine" });
states.Add(new State() { Abbreviations = "MD", Name = "Maryland" });
states.Add(new State() { Abbreviations = "MA", Name = "Massachusetts" });
states.Add(new State() { Abbreviations = "MI", Name = "Michigan" });
states.Add(new State() { Abbreviations = "MN", Name = "Minnesota" });
states.Add(new State() { Abbreviations = "MS", Name = "Mississippi" });
states.Add(new State() { Abbreviations = "MO", Name = "Missouri" });
states.Add(new State() { Abbreviations = "MT", Name = "Montana" });
states.Add(new State() { Abbreviations = "NE", Name = "Nebraska" });
states.Add(new State() { Abbreviations = "NH", Name = "New Hampshire" });
states.Add(new State() { Abbreviations = "NJ", Name = "New Jersey" });
states.Add(new State() { Abbreviations = "NM", Name = "New Mexico" });
states.Add(new State() { Abbreviations = "NY", Name = "New York" });
states.Add(new State() { Abbreviations = "NC", Name = "North Carolina" });
states.Add(new State() { Abbreviations = "NV", Name = "Nevada" });
states.Add(new State() { Abbreviations = "ND", Name = "North Dakota" });
states.Add(new State() { Abbreviations = "OH", Name = "Ohio" });
states.Add(new State() { Abbreviations = "OK", Name = "Oklahoma" });
states.Add(new State() { Abbreviations = "OR", Name = "Oregon" });
states.Add(new State() { Abbreviations = "PA", Name = "Pennsylvania" });
states.Add(new State() { Abbreviations = "RI", Name = "Rhode Island" });
states.Add(new State() { Abbreviations = "SC", Name = "South Carolina" });
states.Add(new State() { Abbreviations = "SD", Name = "South Dakota" });
states.Add(new State() { Abbreviations = "TN", Name = "Tennessee" });
states.Add(new State() { Abbreviations = "TX", Name = "Texas" });
states.Add(new State() { Abbreviations = "UT", Name = "Utah" });
states.Add(new State() { Abbreviations = "VT", Name = "Vermont" });
states.Add(new State() { Abbreviations = "VA", Name = "Virginia" });
states.Add(new State() { Abbreviations = "WA", Name = "Washington" });
states.Add(new State() { Abbreviations = "WV", Name = "West Virginia" });
states.Add(new State() { Abbreviations = "WI", Name = "Wisconsin" });
states.Add(new State() { Abbreviations = "WY", Name = "Wyoming" });
return states.ToList();
}
Run Code Online (Sandbox Code Playgroud)
VB.NET
Public Shared Function CreateStateList() As IList(Of State)
Dim states As New List(Of State)()
states.Add(New State() With {.Abbreviation = "AL", .Name = "Alabama"})
states.Add(New State() With {.Abbreviation = "AK", .Name = "Alaska"})
states.Add(New State() With {.Abbreviation = "AR", .Name = "Arkansas"})
states.Add(New State() With {.Abbreviation = "AZ", .Name = "Arizona"})
states.Add(New State() With {.Abbreviation = "CA", .Name = "California"})
states.Add(New State() With {.Abbreviation = "CO", .Name = "Colorado"})
states.Add(New State() With {.Abbreviation = "CT", .Name = "Connecticut"})
states.Add(New State() With {.Abbreviation = "DC", .Name = "District of Columbia"})
states.Add(New State() With {.Abbreviation = "DE", .Name = "Delaware"})
states.Add(New State() With {.Abbreviation = "FL", .Name = "Florida"})
states.Add(New State() With {.Abbreviation = "GA", .Name = "Georgia"})
states.Add(New State() With {.Abbreviation = "HI", .Name = "Hawaii"})
states.Add(New State() With {.Abbreviation = "ID", .Name = "Idaho"})
states.Add(New State() With {.Abbreviation = "IL", .Name = "Illinois"})
states.Add(New State() With {.Abbreviation = "IN", .Name = "Indiana"})
states.Add(New State() With {.Abbreviation = "IA", .Name = "Iowa"})
states.Add(New State() With {.Abbreviation = "KS", .Name = "Kansas"})
states.Add(New State() With {.Abbreviation = "KY", .Name = "Kentucky"})
states.Add(New State() With {.Abbreviation = "LA", .Name = "Louisiana"})
states.Add(New State() With {.Abbreviation = "ME", .Name = "Maine"})
states.Add(New State() With {.Abbreviation = "MD", .Name = "Maryland"})
states.Add(New State() With {.Abbreviation = "MA", .Name = "Massachusetts"})
states.Add(New State() With {.Abbreviation = "MI", .Name = "Michigan"})
states.Add(New State() With {.Abbreviation = "MN", .Name = "Minnesota"})
states.Add(New State() With {.Abbreviation = "MS", .Name = "Mississippi"})
states.Add(New State() With {.Abbreviation = "MO", .Name = "Missouri"})
states.Add(New State() With {.Abbreviation = "MT", .Name = "Montana"})
states.Add(New State() With {.Abbreviation = "NE", .Name = "Nebraska"})
states.Add(New State() With {.Abbreviation = "NH", .Name = "New Hampshire"})
states.Add(New State() With {.Abbreviation = "NJ", .Name = "New Jersey"})
states.Add(New State() With {.Abbreviation = "NM", .Name = "New Mexico"})
states.Add(New State() With {.Abbreviation = "NY", .Name = "New York"})
states.Add(New State() With {.Abbreviation = "NC", .Name = "North Carolina"})
states.Add(New State() With {.Abbreviation = "NV", .Name = "Nevada"})
states.Add(New State() With {.Abbreviation = "ND", .Name = "North Dakota"})
states.Add(New State() With {.Abbreviation = "OH", .Name = "Ohio"})
states.Add(New State() With {.Abbreviation = "OK", .Name = "Oklahoma"})
states.Add(New State() With {.Abbreviation = "OR", .Name = "Oregon"})
states.Add(New State() With {.Abbreviation = "PA", .Name = "Pennsylvania"})
states.Add(New State() With {.Abbreviation = "RI", .Name = "Rhode Island"})
states.Add(New State() With {.Abbreviation = "SC", .Name = "South Carolina"})
states.Add(New State() With {.Abbreviation = "SD", .Name = "South Dakota"})
states.Add(New State() With {.Abbreviation = "TN", .Name = "Tennessee"})
states.Add(New State() With {.Abbreviation = "TX", .Name = "Texas"})
states.Add(New State() With {.Abbreviation = "UT", .Name = "Utah"})
states.Add(New State() With {.Abbreviation = "VT", .Name = "Vermont"})
states.Add(New State() With {.Abbreviation = "VA", .Name = "Virginia"})
states.Add(New State() With {.Abbreviation = "WA", .Name = "Washington"})
states.Add(New State() With {.Abbreviation = "WV", .Name = "West Virginia"})
states.Add(New State() With {.Abbreviation = "WI", .Name = "Wisconsin"})
states.Add(New State() With {.Abbreviation = "WY", .Name = "Wyoming"})
Return states.ToList()
End Function
Run Code Online (Sandbox Code Playgroud)
这是适合您的国家/地区版本。
public class WorldCountry
{
public WorldCountry()
{
Name = null;
Alpha2Code = null;
Alpha3Code = null;
NumericCode = null;
Enabled = false;
}
public WorldCountry(string name, string alpha2Code, string alpha3Code, string numericCode, bool enabled)
{
Name = name;
Alpha2Code = alpha2Code;
Alpha3Code = alpha3Code;
NumericCode = numericCode;
Enabled = enabled;
}
public string Name { get; set; }
public string Alpha2Code { get; set; }
public string Alpha3Code { get; set; }
public string NumericCode { get; set; }
public bool Enabled { get; set; }
public override string ToString()
{
//Returns "USA - United States"
return string.Format("{0} - {1}", Alpha3Code, Name);
}
}
public class CountryArray
{
public List<WorldCountry> countries;
public CountryArray()
{
countries = new List<WorldCountry>(50);
countries.Add(new WorldCountry("Afghanistan", "AF", "AFG", "004", false));
countries.Add(new WorldCountry("Aland Islands", "AX", "ALA", "248", false));
countries.Add(new WorldCountry("Albania", "AL", "ALB", "008", false));
countries.Add(new WorldCountry("Algeria", "DZ", "DZA", "012", false));
countries.Add(new WorldCountry("American Samoa", "AS", "ASM", "016", false));
countries.Add(new WorldCountry("Andorra", "AD", "AND", "020", false));
countries.Add(new WorldCountry("Angola", "AO", "AGO", "024", false));
countries.Add(new WorldCountry("Anguilla", "AI", "AIA", "660", false));
countries.Add(new WorldCountry("Antarctica", "AQ", "ATA", "010", false));
countries.Add(new WorldCountry("Antigua and Barbuda", "AG", "ATG", "028", false));
countries.Add(new WorldCountry("Argentina", "AR", "ARG", "032", false));
countries.Add(new WorldCountry("Armenia", "AM", "ARM", "051", false));
countries.Add(new WorldCountry("Aruba", "AW", "ABW", "533", false));
countries.Add(new WorldCountry("Australia", "AU", "AUS", "036", false));
countries.Add(new WorldCountry("Austria", "AT", "AUT", "040", false));
countries.Add(new WorldCountry("Azerbaijan", "AZ", "AZE", "031", false));
countries.Add(new WorldCountry("Bahamas", "BS", "BHS", "044", false));
countries.Add(new WorldCountry("Bahrain", "BH", "BHR", "048", false));
countries.Add(new WorldCountry("Bangladesh", "BD", "BGD", "050", false));
countries.Add(new WorldCountry("Barbados", "BB", "BRB", "052", false));
countries.Add(new WorldCountry("Belarus", "BY", "BLR", "112", false));
countries.Add(new WorldCountry("Belgium", "BE", "BEL", "056", false));
countries.Add(new WorldCountry("Belize", "BZ", "BLZ", "084", false));
countries.Add(new WorldCountry("Benin", "BJ", "BEN", "204", false));
countries.Add(new WorldCountry("Bermuda", "BM", "BMU", "060", false));
countries.Add(new WorldCountry("Bhutan", "BT", "BTN", "064", false));
countries.Add(new WorldCountry("Bolivia, Plurinational State of", "BO", "BOL", "068", false));
countries.Add(new WorldCountry("Bonaire, Sint Eustatius and Saba", "BQ", "BES", "535", false));
countries.Add(new WorldCountry("Bosnia and Herzegovina", "BA", "BIH", "070", false));
countries.Add(new WorldCountry("Botswana", "BW", "BWA", "072", false));
countries.Add(new WorldCountry("Bouvet Island", "BV", "BVT", "074", false));
countries.Add(new WorldCountry("Brazil", "BR", "BRA", "076", false));
countries.Add(new WorldCountry("British Indian Ocean Territory", "IO", "IOT", "086", false));
countries.Add(new WorldCountry("Brunei Darussalam", "BN", "BRN", "096", false));
countries.Add(new WorldCountry("Bulgaria", "BG", "BGR", "100", false));
countries.Add(new WorldCountry("Burkina Faso", "BF", "BFA", "854", false));
countries.Add(new WorldCountry("Burundi", "BI", "BDI", "108", false));
countries.Add(new WorldCountry("Cambodia", "KH", "KHM", "116", false));
countries.Add(new WorldCountry("Cameroon", "CM", "CMR", "120", false));
countries.Add(new WorldCountry("Canada", "CA", "CAN", "124", true));
countries.Add(new WorldCountry("Cape Verde", "CV", "CPV", "132", false));
countries.Add(new WorldCountry("Cayman Islands", "KY", "CYM", "136", false));
countries.Add(new WorldCountry("Central African Republic", "CF", "CAF", "140", false));
countries.Add(new WorldCountry("Chad", "TD", "TCD", "148", false));
countries.Add(new WorldCountry("Chile", "CL", "CHL", "152", false));
countries.Add(new WorldCountry("China", "CN", "CHN", "156", false));
countries.Add(new WorldCountry("Christmas Island", "CX", "CXR", "162", false));
countries.Add(new WorldCountry("Cocos (Keeling) Islands", "CC", "CCK", "166", false));
countries.Add(new WorldCountry("Colombia", "CO", "COL", "170", false));
countries.Add(new WorldCountry("Comoros", "KM", "COM", "174", false));
countries.Add(new WorldCountry("Congo", "CG", "COG", "178", false));
countries.Add(new WorldCountry("Congo, the Democratic Republic of the", "CD", "COD", "180", false));
countries.Add(new WorldCountry("Cook Islands", "CK", "COK", "184", false));
countries.Add(new WorldCountry("Costa Rica", "CR", "CRI", "188", false));
countries.Add(new WorldCountry("Cote d'Ivoire", "CI", "CIV", "384", false));
countries.Add(new WorldCountry("Croatia", "HR", "HRV", "191", false));
countries.Add(new WorldCountry("Cuba", "CU", "CUB", "192", false));
countries.Add(new WorldCountry("Curacao", "CW", "CUW", "531", false));
countries.Add(new WorldCountry("Cyprus", "CY", "CYP", "196", false));
countries.Add(new WorldCountry("Czech Republic", "CZ", "CZE", "203", false));
countries.Add(new WorldCountry("Denmark", "DK", "DNK", "208", false));
countries.Add(new WorldCountry("Djibouti", "DJ", "DJI", "262", false));
countries.Add(new WorldCountry("Dominica", "DM", "DMA", "212", false));
countries.Add(new WorldCountry("Dominican Republic", "DO", "DOM", "214", false));
countries.Add(new WorldCountry("Ecuador", "EC", "ECU", "218", false));
countries.Add(new WorldCountry("Egypt", "EG", "EGY", "818", false));
countries.Add(new WorldCountry("El Salvador", "SV", "SLV", "222", false));
countries.Add(new WorldCountry("Equatorial Guinea", "GQ", "GNQ", "226", false));
countries.Add(new WorldCountry("Eritrea", "ER", "ERI", "232", false));
countries.Add(new WorldCountry("Estonia", "EE", "EST", "233", false));
countries.Add(new WorldCountry("Ethiopia", "ET", "ETH", "231", false));
countries.Add(new WorldCountry("Falkland Islands (Malvinas)", "FK", "FLK", "238", false));
countries.Add(new WorldCountry("Faroe Islands", "FO", "FRO", "234", false));
countries.Add(new WorldCountry("Fiji", "FJ", "FJI", "242", false));
countries.Add(new WorldCountry("Finland", "FI", "FIN", "246", false));
countries.Add(new WorldCountry("France", "FR", "FRA", "250", false));
countries.Add(new WorldCountry("French Guiana", "GF", "GUF", "254", false));
countries.Add(new WorldCountry("French Polynesia", "PF", "PYF", "258", false));
countries.Add(new WorldCountry("French Southern Territories", "TF", "ATF", "260", false));
countries.Add(new WorldCountry("Gabon", "GA", "GAB", "266", false));
countries.Add(new WorldCountry("Gambia", "GM", "GMB", "270", false));
countries.Add(new WorldCountry("Georgia", "GE", "GEO", "268", false));
countries.Add(new WorldCountry("Germany", "DE", "DEU", "276", false));
countries.Add(new WorldCountry("Ghana", "GH", "GHA", "288", false));
countries.Add(new WorldCountry("Gibraltar", "GI", "GIB", "292", false));
countries.Add(new WorldCountry("Greece", "GR", "GRC", "300", false));
countries.Add(new WorldCountry("Greenland", "GL", "GRL", "304", false));
countries.Add(new WorldCountry("Grenada", "GD", "GRD", "308", false));
countries.Add(new WorldCountry("Guadeloupe", "GP", "GLP", "312", false));
countries.Add(new WorldCountry("Guam", "GU", "GUM", "316", false));
countries.Add(new WorldCountry("Guatemala", "GT", "GTM", "320", false));
countries.Add(new WorldCountry("Guernsey", "GG", "GGY", "831", false));
countries.Add(new WorldCountry("Guinea", "GN", "GIN", "324", false));
countries.Add(new WorldCountry("Guinea-Bissau", "GW", "GNB", "624", false));
countries.Add(new WorldCountry("Guyana", "GY", "GUY", "328", false));
countries.Add(new WorldCountry("Haiti", "HT", "HTI", "332", false));
countries.Add(new WorldCountry("Heard Island and McDonald Islands", "HM", "HMD", "334", false));
countries.Add(new WorldCountry("Holy See (Vatican City State)", "VA", "VAT", "336", false));
countries.Add(new WorldCountry("Honduras", "HN", "HND", "340", false));
countries.Add(new WorldCountry("Hong Kong", "HK", "HKG", "344", false));
countries.Add(new WorldCountry("Hungary", "HU", "HUN", "348", false));
countries.Add(new WorldCountry("Iceland", "IS", "ISL", "352", false));
countries.Add(new WorldCountry("India", "IN", "IND", "356", false));
countries.Add(new WorldCountry("Indonesia", "ID", "IDN", "360", false));
countries.Add(new WorldCountry("Iran, Islamic Republic of", "IR", "IRN", "364", false));
countries.Add(new WorldCountry("Iraq", "IQ", "IRQ", "368", false));
countries.Add(new WorldCountry("Ireland", "IE", "IRL", "372", false));
countries.Add(new WorldCountry("Isle of Man", "IM", "IMN", "833", false));
countries.Add(new WorldCountry("Israel", "IL", "ISR", "376", false));
countries.Add(new WorldCountry("Italy", "IT", "ITA", "380", false));
countries.Add(new WorldCountry("Jamaica", "JM", "JAM", "388", false));
countries.Add(new WorldCountry("Japan", "JP", "JPN", "392", false));
countries.Add(new WorldCountry("Jersey", "JE", "JEY", "832", false));
countries.Add(new WorldCountry("Jordan", "JO", "JOR", "400", false));
countries.Add(new WorldCountry("Kazakhstan", "KZ", "KAZ", "398", false));
countries.Add(new WorldCountry("Kenya", "KE", "KEN", "404", false));
countries.Add(new WorldCountry("Kiribati", "KI", "KIR", "296", false));
countries.Add(new WorldCountry("Korea, Democratic People's Republic of", "KP", "PRK", "408", false));
countries.Add(new WorldCountry("Korea, Republic of", "KR", "KOR", "410", false));
countries.Add(new WorldCountry("Kuwait", "KW", "KWT", "414", false));
countries.Add(new WorldCountry("Kyrgyzstan", "KG", "KGZ", "417", false));
countries.Add(new WorldCountry("Lao People's Democratic Republic", "LA", "LAO", "418", false));
countries.Add(new WorldCountry("Latvia", "LV", "LVA", "428", false));
countries.Add(new WorldCountry("Lebanon", "LB", "LBN", "422", false));
countries.Add(new WorldCountry("Lesotho", "LS", "LSO", "426", false));
countries.Add(new WorldCountry("Liberia", "LR", "LBR", "430", false));
countries.Add(new WorldCountry("Libya", "LY", "LBY", "434", false));
countries.Add(new WorldCountry("Liechtenstein", "LI", "LIE", "438", false));
countries.Add(new WorldCountry("Lithuania", "LT", "LTU", "440", false));
countries.Add(new WorldCountry("Luxembourg", "LU", "LUX", "442", false));
countries.Add(new WorldCountry("Macao", "MO", "MAC", "446", false));
countries.Add(new WorldCountry("Macedonia, the former Yugoslav Republic of", "MK", "MKD", "807", false));
countries.Add(new WorldCountry("Madagascar", "MG", "MDG", "450", false));
countries.Add(new WorldCountry("Malawi", "MW", "MWI", "454", false));
countries.Add(new WorldCountry("Malaysia", "MY", "MYS", "458", false));
countries.Add(new WorldCountry("Maldives", "MV", "MDV", "462", false));
countries.Add(new WorldCountry("Mali", "ML", "MLI", "466", false));
countries.Add(new WorldCountry("Malta", "MT", "MLT", "470", false));
countries.Add(new WorldCountry("Marshall Islands", "MH", "MHL", "584", false));
countries.Add(new WorldCountry("Martinique", "MQ", "MTQ", "474", false));
countries.Add(new WorldCountry("Mauritania", "MR", "MRT", "478", false));
countries.Add(new WorldCountry("Mauritius", "MU", "MUS", "480", false));
countries.Add(new WorldCountry("Mayotte", "YT", "MYT", "175", false));
countries.Add(new WorldCountry("Mexico", "MX", "MEX", "484", false));
countries.Add(new WorldCountry("Micronesia, Federated States of", "FM", "FSM", "583", false));
countries.Add(new WorldCountry("Moldova, Republic of", "MD", "MDA", "498", false));
countries.Add(new WorldCountry("Monaco", "MC", "MCO", "492", false));
countries.Add(new WorldCountry("Mongolia", "MN", "MNG", "496", false));
countries.Add(new WorldCountry("Montenegro", "ME", "MNE", "499", false));
countries.Add(new WorldCountry("Montserrat", "MS", "MSR", "500", false));
countries.Add(new WorldCountry("Morocco", "MA", "MAR", "504", false));
countries.Add(new WorldCountry("Mozambique", "MZ", "MOZ", "508", false));
countries.Add(new WorldCountry("Myanmar", "MM", "MMR", "104", false));
countries.Add(new WorldCountry("Namibia", "NA", "NAM", "516", false));
countries.Add(new WorldCountry("Nauru", "NR", "NRU", "520", false));
countries.Add(new WorldCountry("Nepal", "NP", "NPL", "524", false));
countries.Add(new WorldCountry("Netherlands", "NL", "NLD", "528", false));
countries.Add(new WorldCountry("New Caledonia", "NC", "NCL", "540", false));
countries.Add(new WorldCountry("New Zealand", "NZ", "NZL", "554", false));
countries.Add(new WorldCountry("Nicaragua", "NI", "NIC", "558", false));
countries.Add(new WorldCountry("Niger", "NE", "NER", "562", false));
countries.Add(new WorldCountry("Nigeria", "NG", "NGA", "566", false));
countries.Add(new WorldCountry("Niue", "NU", "NIU", "570", false));
countries.Add(new WorldCountry("Norfolk Island", "NF", "NFK", "574", false));
countries.Add(new WorldCountry("Northern Mariana Islands", "MP", "MNP", "580", false));
countries.Add(new WorldCountry("Norway", "NO", "NOR", "578", false));
countries.Add(new WorldCountry("Oman", "OM", "OMN", "512", false));
countries.Add(new WorldCountry("Pakistan", "PK", "PAK", "586", false));
countries.Add(new WorldCountry("Palau", "PW", "PLW", "585", false));
countries.Add(new WorldCountry("Palestine, State of", "PS", "PSE", "275", false));
countries.Add(new WorldCountry("Panama", "PA", "PAN", "591", false));
countries.Add(new WorldCountry("Papua New Guinea", "PG", "PNG", "598", false));
countries.Add(new WorldCountry("Paraguay", "PY", "PRY", "600", false));
countries.Add(new WorldCountry("Peru", "PE", "PER", "604", false));
countries.Add(new WorldCountry("Philippines", "PH", "PHL", "608", false));
countries.Add(new WorldCountry("Pitcairn", "PN", "PCN", "612", false));
countries.Add(new WorldCountry("Poland", "PL", "POL", "616", false));
countries.Add(new WorldCountry("Portugal", "PT", "PRT", "620", false));
countries.Add(new WorldCountry("Puerto Rico", "PR", "PRI", "630", false));
countries.Add(new WorldCountry("Qatar", "QA", "QAT", "634", false));
countries.Add(new WorldCountry("Reunion", "RE", "REU", "638", false));
countries.Add(new WorldCountry("Romania", "RO", "ROU", "642", false));
countries.Add(new WorldCountry("Russian Federation", "RU", "RUS", "643", false));
countries.Add(new WorldCountry("Rwanda", "RW", "RWA", "646", false));
countries.Add(new WorldCountry("Saint Barthélemy", "BL", "BLM", "652", false));
countries.Add(new WorldCountry("Saint Helena, Ascension and Tristan da Cunha", "SH", "SHN", "654", false));
countries.Add(new WorldCountry("Saint Kitts and Nevis", "KN", "KNA", "659", false));
countries.Add(new WorldCountry("Saint Lucia", "LC", "LCA", "662", false));
countries.Add(new WorldCountry("Saint Martin (French part)", "MF", "MAF", "663", false));
countries.Add(new WorldCountry("Saint Pierre and Miquelon", "PM", "SPM", "666", false));
countries.Add(new WorldCountry("Saint Vincent and the Grenadines", "VC", "VCT", "670", false));
countries.Add(new WorldCountry("Samoa", "WS", "WSM", "882", false));
countries.Add(new WorldCountry("San Marino", "SM", "SMR", "674", false));
countries.Add(new WorldCountry("Sao Tome and Principe", "ST", "STP", "678", false));
countries.Add(new WorldCountry("Saudi Arabia", "SA", "SAU", "682", false));
countries.Add(new WorldCountry("Senegal", "SN", "SEN", "686", false));
countries.Add(new WorldCountry("Serbia", "RS", "SRB", "688", false));
countries.Add(new WorldCountry("Seychelles", "SC", "SYC", "690", false));
countries.Add(new WorldCountry("Sierra Leone", "SL", "SLE", "694", false));
countries.Add(new WorldCountry("Singapore", "SG", "SGP", "702", false));
countries.Add(new WorldCountry("Sint Maarten (Dutch part)", "SX", "SXM", "534", false));
countries.Add(new WorldCountry("Slovakia", "SK", "SVK", "703", false));
countries.Add(new WorldCountry("Slovenia", "SI", "SVN", "705", false));
countries.Add(new WorldCountry("Solomon Islands", "SB", "SLB", "090", false));
countries.Add(new WorldCountry("Somalia", "SO", "SOM", "706", false));
countries.Add(new WorldCountry("South Africa", "ZA", "ZAF", "710", false));
countries.Add(new WorldCountry("South Georgia and the South Sandwich Islands", "GS", "SGS", "239", false));
countries.Add(new WorldCountry("South Sudan", "SS", "SSD", "728", false));
countries.Add(new WorldCountry("Spain", "ES", "ESP", "724", false));
countries.Add(new WorldCountry("Sri Lanka", "LK", "LKA", "144", false));
countries.Add(new WorldCountry("Sudan", "SD", "SDN", "729", false));
countries.Add(new WorldCountry("Suriname", "SR", "SUR", "740", false));
countries.Add(new WorldCountry("Svalbard and Jan Mayen", "SJ", "SJM", "744", false));
countries.Add(new WorldCountry("Swaziland", "SZ", "SWZ", "748", false));
countries.Add(new WorldCountry("Sweden", "SE", "SWE", "752", false));
countries.Add(new WorldCountry("Switzerland", "CH", "CHE", "756", false));
countries.Add(new WorldCountry("Syrian Arab Republic", "SY", "SYR", "760", false));
countries.Add(new WorldCountry("Taiwan, Province of China", "TW", "TWN", "158", false));
countries.Add(new WorldCountry("Tajikistan", "TJ", "TJK", "762", false));
countries.Add(new WorldCountry("Tanzania, United Republic of", "TZ", "TZA", "834", false));
countries.Add(new WorldCountry("Thailand", "TH", "THA", "764", false));
countries.Add(new WorldCountry("Timor-Leste", "TL", "TLS", "626", false));
countries.Add(new WorldCountry("Togo", "TG", "TGO", "768", false));
countries.Add(new WorldCountry("Tokelau", "TK", "TKL", "772", false));
countries.Add(new WorldCountry("Tonga", "TO", "TON", "776", false));
countries.Add(new WorldCountry("Trinidad and Tobago", "TT", "TTO", "780", false));
countries.Add(new WorldCountry("Tunisia", "TN", "TUN", "788", false));
countries.Add(new WorldCountry("Turkey", "TR", "TUR", "792", false));
countries.Add(new WorldC