Monday, March 17, 2008

Determine Web Visitors Country of Origin in the Drop Down List using .NET Framework in C or VB.NET

Hexasoft development of the Sustainable Development Network. Bhd (645996 - k) 1-2-15 mayang Mall complex, Jalan mayang Pasir 1, the statement 11950 Bandar Baru, Penang, Malaysia. () Sales@ip2location.com with the emergence of Internet technologies such as the Internet, and the people and businesses have increased the adoption and use of such media as a tool of the trade that it might be more appropriate. During transactions online, and there are times when important advance Web Visitor country of origin, zip code, Internet service providers, domain name, in their bid to prevent fraud list and easy to complicate the task of registration. This article shows you how to use. Net framework, can be done. Take a simple example of a user from entering Canada, he needs to fill up a shopping cart. Form can be very complex as some items need more information to prevent fraud. In this case, there is a need for some information in advance to topple the list, such as the country of origin, Zip code, and a domain name of intellectual property in terms of entry users. As a result, the drop list in this instance will advance to cananda, with the correct zip code and IP address. In this example, we use the fully functional ip2location . Net component available in the query through http://www.ip2location.net/download/ip2locationdotnetcomponent.zip country Visitor IP address. First, install ip2location . Net component. The ip2location . Net component will be installed in the engine of your local disk. Next, for ip2location.dll. Net component database sample of the guide, no. C: Program Files ip2location default. You need to add a reference to this component of your web visual studio project. A copy of this element will be copied into the / bin directory under the project. Registered component, and a random second 5 - delay in one out of ten queries.
sample codes in vb.net webform ------------------------ -- ---- imports ip2location Special query subsection (byval stripaddress also thread) oipresult bleak as trying new ip2location.ipresult if stripaddress " " then ip2location.component.ipdatabasepath = " c: / Program Files ip2location database IP - country.sample.bin " oipresult = ip2location.component.ipquery (stripaddress) Select Case issue oipresult.status & quot; OK if " oipresult.countryshort & quot ; - " then response.write (" ") response.write (" " & Oipresult.countrylong & " & quot;) response.write (" Afghanistan & quot;) response.write (" Albania & quot;) response.write (" Algeria & quot;) response.write (" American Samoa & quot;) response.write (" Andorra & quot;) response. Write (" Angola & quot;) response.write (" Anguilla & quot;) response.write (" Antarctica & quot;) response.write (" Antigua and Barbuda & quot; ") response.write (Argentina & quot;) response.write (" Armenia & quot;) response. Write (" Aruba & quot;) response.write (" Asia and the Pacific & quot;) response.write (" Australia & quot;) response.write (" Austria & quot ;) response.write (" Azerbaijan & quot;) response.write (" Bahamas & quot;) response.write (" Bahrain & quot;) response.write (" Bangladesh & quot;) response.write (" Barbados & quot;) response.write (" Belarus & quot;) response.write (" Belgium & quot;) response.write (& quot; Belize & quot;) response.write (" Benin ") response.write (" Bermuda ") response.write (" Bhutan ") response . write (" Bolivia ") response.write (" Bosnia and herzegowina ") response.write (" Botswana ") response.write (" Bouvet Island ") response.write (" Brazil ") response.write (" British Indian Ocean Territory ") response.write (" Brunei Darussalam & ; quot;) response.write (" Bulgaria ") response.write (" Burkina Faso " (reply. write (" Burundi & quot;) response.write ( " Cambodia & quot;) response.write (Cameroon " & quot;) response.write (" Canada & quot;) response.write (" Cape Verde & quot;) response . write (" Cayman Islands & quot;) response. write (" Central African Republic & quot;) response.write (" Chad & quot;) response.write (" & Chile ; quot;) response.write (" China & quot;) response.write (" Christmas Island & quot;) response.write (" Cocos (Keeling (" Islands) response . write (" Colombia ") response.write (" Comoros ") response.write (" Congo ") response.write (" Democratic Republic of Congo ") response.write (" Cook Islands " (Response.write (Costa Rica " & quot;) response.write (" Ivory Coast & quot;) response.write (" Croatia & quot;) response.write (" Cuba & quot;) response.write (" Cyprus & quot;) response.write (" & Czech Republic ; quot;) response.write (" (former) Czechoslovakia ") response.write (" Denmark ") response.write (" Djibouti ") response . write (" Dominica ") response.write (" Dominican Republic ") response. write (" East Timor & quot;) response.write (" Ecuador & quot;) response.write (" Egypt & quot;) response.write (" El Salvador & quot;) response.write (" Equatorial Guinea & quot;) response.write (& ; quot; Eritrea & quot;) response. write (" Estonia & quot;) response.write (" Ethiopia & quot;) response.write (EU " & quot;) response. write (" Falkland Islands (Malvinas) & quot;) response.write (" Faroe Islands & quot;) response.write (" Fiji ") response.write (& quot; Finland ") response.write (" France ") response.write (" France, the Metropolitan ") response.write (" & French Guyana quot;) response.write (" French Polynesia ") response.write (" French Southern Territories & quot;) response.write (" Gabon & quot;) response.write ( " Gambia & quot;) response.write (" Georgia & quot;) response.write (Germany " & quot;) response.write (" Ghana & quot;) response. write (" Gibraltar & quot;) response.write (" Great Britain & quot;) response.write (" Greece & quot;) response.write (" Greenland & quot ;) response.write (" Grenada & quot;) response.write (" Guadeloupe & quot;) response.write (" Guam & quot;) response.write (" & Guatemala ; quot;) response.write (" Guinea & quot;) response.write (" Guinea Bissau & quot;) response.write (" Guyana & quot;) response.write (& quot; Haiti & quot;) response.write (" Heard Island and McDonald Islands & quot;) response.write (" Holy See (Vatican City State) & quot;) response.write (" Honduras & quot;) response.write (" Hong Kong & quot;) response.write (" Hungary & quot;) response.write (" Iceland & quot;) response.write (& ; quot; India & quot;) response.write (" Indonesia & quot;) response.write (" Islamic Republic of Iran & quot;) response.write (" Iraq & quot;) response . write (" Ireland & quot;) response. write (" Israel & quot;) response.write (" Italy & quot;) response.write (" Jamaica & quot; ") response.write (Japan & quot;) response.write (" Jordan & quot;) response.write (" Kazakhstan & quot;) response.write (Kenya & " quot;) response.write (" Kiribati & quot;) response.write (" Korea, Democratic People& 39;s Republic & quot;) response.write (" Korea, Republic & quot;) response. write (" Kuwait & quot;) response.write (" Kyrgyzstan ") response.write (" Lao People& 39;s Democratic Republic ") response.write (" Latvia ") response.write (" Lebanon ") response.write (" Lesotho ") response.write (" Liberia ") response. write (" Libyan Arab Jamahiriya & quot;) response.write (" Liechtenstein & quot;) response.write (" Lithuania & quot;) response.write (" Luxembourg & quot ;) response.write (" Macao & quot;) response.write (" Macedonia, a republic of the former Yugoslavia ") Response.write (" Madagascar ") response. write (" Malawi ") response.write (" Malaysia ") response.write (" Maldives ") response.write (" & Mali ; quot;) response.write (" Malta ") Response.write (" Marshall Islands & quot;) response.write (" Martinique & quot;) response.write (& ; quot; Mauritania & quot;) response.write (" Mauritius & quot;) response.write (" Mayotte & quot;) response.write (" Mexico & quot; (reply. write (" Micronesia, Federated States & quot;) response.write (" Moldova, Republic & quot;) response.write (" Monaco & quot;) response.write (" & Mongolia quot;) response.write (" Montserrat & quot;) response.write (" Morocco & quot;) response.write (" Mozambique & quot;) response.write (" Myanmar & quot;) response.write (" Namibia & quot;) response.write (" Nauru & quot;) response.write (" Nepal & quot;) response.write (& quot; " Netherlands) Response.write (" Netherlands Antilles ") response.write (" New Caledonia ") response.write (" & New Zealand quot;) response.write (" Nicaragua ") response.write (" Niger ") response.write (" Nigeria ") response.write (& ; quot; Niue ") response.write (" Norfolk Island ") response.write (" Northern Mariana Islands ") response.write (Norway & " ; quot;) response.write (" Oman ") response.write (Pakistan " & quot;) response.write (" Palau & quot;) response.write (& quot; Occupied Palestinian Territory & quot;) response.write (" Panama & quot;) response.write (" Papua New Guinea & quot;) response.write (" Paraguay & quot;) response. write (" Peru & quot;) response.write (" Philippines & quot;) response.write (" Pitcairn & quot;) response.write (" Poland & quot ;) response.write (" Portugal & quot;) response.write (" Puerto Rico & quot;) response. write (" Qatar & quot;) response.write (not " reunion & quot;) response.write (" Romania & quot;) response.write (" Russian Federation & quot;) response.write (" Rwanda & quot;) response.write (& ; quot; Saint Helena & quot;) response. write (" St. Kitts and Nevis & quot;) response.write (" St. Lucia & quot;) response.write (" St. Pierre and Miquelon & quot;) response.write (" St. Vincent and the Grenadines & quot;) response.write (" Samoa & quot; (reply. write (" San Marino & quot;) response.write (& ; quot; Sao Tome and Principe & quot;) response.write (Saudi " & quot;) response.write (" Senegal & quot;) response.write (" Serbia and Montenegro & quot; ") response.write (Seychelles & quot;) response.write (" Sierra Leone & quot;) response.write (" Singapore & quot;) response.write (" & Slovakia quot;) response.write (" Slovenia & quot;) response.write (" Solomon Islands & quot;) response.write (" Somalia & quot;) response.write (& quot ; South Africa & quot;) response.write (" South Georgia and South Sandwich Islands & quot;) response.write (Spain " & quot;) response.write (" Sri Lanka & quot; ) response.write (" Sudan ") Response.write (" Suriname ") response.write (" Svalbard and Jan Mayen ") response.write (& ; quot; Swaziland ") response.write (" Sweden ") response.write (" Switzerland ") response.write (" Syrian Arab Republic & quot;) response.write (" Taiwan Province of China ") response.write (" Tajikistan ") response.write (" Tanzania, the Republic ") response.write (" Thailand ") response.write (" Togo ") response.write (" Tokelau ") response.write (" Tonga ") response.write (" Trinidad and Tobago ") response.write (" Tunisia ") response.write (" Turkey ") response . write (" Turkmenistan ") response.write (" Turks and Caicos Islands ") response.write (" Tuvalu ") response.write (& quot ; Uganda ") response.write (" Ukraine ") response.write (" United Arab Emirates ") response. write (" UK & quot; ") response.write (United States & quot;) response.write (" United States Minor Outlying Islands & quot;) response.write (" Uruguay & quot;) response.write ( Uzbekistan " & quot;) response.write (" Vanuatu ") Response.write (" Venezuela ") response.write (" Vietnam " ") response.write (and the British Virgin Islands ") response.write (" Virgin Islands, the United States ") response.write (" Wallis and Futuna " ( Response.write (" Western Sahara & quot;) response.write (" Yemen & quot;) response.write (" Zambia & quot;) response.write (" & Zimbabwe quot;) response.write (" ") If the end of the case " empty ip address " response.write (" IP address can not be empty. & quot;) Case " invalid ip address " response.write (" invalid IP address. & quot;) Case " missing file " response.write (" course of the database is not valid. & ; quot;) End Select another response.write (" IP Address can not be empty. ") end if hunting as a former exception response.write (ex.message), and last but not the end oipresult = Try symbols at the end sub
sample c webform ------------------ ------------ private void query (thread) (stripaddress ipresult oipresult = new ip2location . ipresult (); (if tested (stripaddress! = " ") (Ip2location.component.ipdatabasepath = " c: Program Files ip2location database - country. sample.bin IP "; oipresult = ip2location.component.ipquery (stripaddress); switch (oipresult.status.tostring ()) (Case & quot; OK ": If) Oipresult.countryshort! = & ; quot; - ") (Response.write (" "); response.write (" " oipresult.countrylong + + " " ); response.write (" Afghanistan & quot;); response.write (" Albania & quot;); Response.write (" Algeria & quot;); response.write (& quot; American Samoa & quot;); response.write (" Andorra & quot;); response.write (" Angola & quot;); response.write (" Anguilla & quot;) ; response.write (" Antarctica & quot;); response.write (" Antigua and Barbuda & quot;); response.write (" Argentina & quot;); response.write (& quot; Armenia & quot;); response.write (" Aruba & quot;); response.write (" Asia Pacific "); response.write (Australia & " quot;); response.write (" " Austria); response.write (" " Azerbaijan); response.write (" Bahamas "); response.write (" " Bahrain); response. write (" Bangladesh & quot;); response.write (" Barbados & quot;); response.write (& quot ; Belarus & quot;); response.write (" Belgium & quot;); response.write (" Belize & quot;); response.write (" " Benin); Response.write (" " Bermuda); response.write (" " Bhutan); response.write (" " Bolivia); response.write (& ; quot; Bosnia and herzegowina "); response.write (" " Botswana); Response.write (" Bouvet Island & quot;); response.write (Brazil & " ; quot;); response.write (" British Indian Ocean Territory & quot;); response.write (" Brunei Darussalam & quot;); response.write (" Bulgaria & quot; ); Response.write (" Burkina Faso & quot;); response.write (" Burundi & quot;); response.write (" Cambodia & quot;); response.write (& ; quot; Cameroon & quot;); response.write (" Canada & quot;); response.write) " Cape Verde & quot;); response.write (" Cayman Islands & quot ;); response.write (" Central African Republic & quot;); response.write (" Chad & quot;); response.write (" Chile & quot;); response.write (" " China); response.write (" Christmas Island "); response.write (" Islands Cox) " Keeling); response.write ( " " Colombia); response.write (" Comoros "); response.write (" " Congo); response.write (" " Democratic Republic of Congo); response.write (" " Cook Islands); response.write (" " Costa Rica); response.write (" Ivory Coast "); Response.write (" Croatia & quot;); response.write (" Cuba & quot;); response.write (" Cyprus & quot;); response. write (" Czech Republic & quot;); response.write (" Czechoslovakia (former) & quot;); Response.write (" Denmark & quot;); response.write (& ; quot; Djibouti & quot;); response.write (" Dominica & quot;); response.write (" Dominican Republic & quot;); response.write (" East Timor & quot ;); response.write (" Ecuador & quot;); response.write (" Egypt & quot;); response.write (" El Salvador & quot;); response.write (& ; quot; Equatorial Guinea & quot;); response.write (" Eritrea & quot;); response.write (" " Estonia); Response.write (" & Ethiopia quot;); response.write (" EU "); response.write (" Falkland Islands (Malvinas) "); response.write (Faroe Islands & " ; quot;); response.write (" " Fiji); response.write (" " Finland); response.write (" " France); response.write (" France, the Metropolitan "); response.write (" " French Guyana); response.write (" " French Polynesia); Response . write (" French Southern Territories "); response.write (" " Gabon); response.write (" " Gambia); response.write ( " " Georgia); response.write (" " Germany); Response.write (" Ghana & quot;); response.write (" & Gibraltar ; quot;); response.write (" Great Britain & quot;); response.write (" Greece & quot;); response.write (" Greenland & quot;); response. write) " Grenada & quot;); response.write (" Guadeloupe & quot;); response.write (" Guam & quot;); response.write (" & Guatemala quot;); response.write (" Guinea & quot;); response.write (" Guinea Bissau & quot; (; Response.write (" Guyana & quot;); response.write (" Haiti & quot;); response.write (" Heard Island and McDonald Islands & quot;); response.write (" Holy See (Vatican City State) & quot;); response. write (" Honduras & quot;); response.write (" Hong Kong & quot;); response.write (" Hungary & quot;); response.write (" & Iceland ; quot;); response.write (" India & quot;); response.write (" " Indonesia); Response.write (" Islamic Republic of Iran ") ; response.write (" Iraq "); response.write (" " Ireland); response.write (" " Israel); response.write ( " Italy " (; Response.write (" Jamaica & quot;); response.write (Japan " & quot;); response.write (" Jordan & quot ;); response.write (" Kazakhstan & quot;); response.write (" Kenya & quot;); response.write (" Kiribati & quot;); response.write (& ; quot; Korea, Democratic People& 39;s Republic & quot;); response.write (" Korea, Republic & quot;); response.write (" Kuwait & quot;); response.write (& quot ; Kyrgyzstan & quot;); Response.write (" Lao People& 39;s Democratic Republic & quot;); response.write (" Latvia & quot;); response.write (" Lebanon & quot; ); response.write (" Lesotho & quot;); response.write (" Liberia & quot;); & tomeka amie



Bookmark it: del.icio.usdigg.comreddit.comnetvouz.comgoogle.comyahoo.comtechnorati.comfurl.netbloglines.comsocialdust.comma.gnolia.comnewsvine.comslashdot.orgsimpy.com

No comments: