Being able to tell on-the-fly which country your visitors come from is a big boon. The applications are numerous. You can use it to extend your security by limiting to certain countries only. Or perhaps you want present a different page or ad per country. Or you just want to automatically select the country in the dropdown of your forms.
Fortunately, thanks to MaxMind, this is all free and easy. Here are 5 simple steps:
1. Download API files and extract
2. Copy CountryLookup.vb to you App_Code folder or Class Library
3. Download Database and extract
4. Copy GeoIP.dat and place it on your website.
5. Start using it.
Dim _UserIPAddress As String = Me.Page.Request.UserHostAddress
Dim _IPDataPath As String = Me.Page.Server.MapPath("data/GeoIP.dat") 'relative path to the Geo IP Database.
Dim _CountryLookup As CountryLookup = New CountryLookup(_IPDataPath)
Dim _CountryName As String = _CountryLookup.LookupCountryName(_UserIPAddress)
Response.Write(_CountryName)
C# API is also available here as well as other programming languages. APIs also come with country flag images which you can use to create cool user interfaces.
Find IP Address Location By Country in ASP.Net
·
Subscribe to:
Post Comments (Atom)
Featured Tools
Recent Posts
Categories
- Asp.Net (9)
- Software (8)
- Personal Computing (5)
- Flash Drive Viruses (4)
- Internet (3)
- Publishing (3)
- SEO (2)
- Finance (1)
- Overseas Filipino Workers (OFWs) (1)
- Parenting (1)
- SQL Server (1)
- XSL-FO (1)
- jQuery (1)
- nFOP (1)
Archive
-
▼
2008
(
16
)
-
▼
August
(
9
)
- DNN (Dotnetnuke) module development in 10 easy steps
- Find IP Address Location By Country in ASP.Net
- Free counter and web analytics in real-time
- Search Optimization - Using the right keywords
- OpenDNS - Filtering your child's web surfing for Free
- IAM Flash Shield - Active Protection Against Remov...
- IAM Flash Shield
- Flash Drive Viruses (Aikelyu / deadly-c.vbs / pooh...
- IAM Flash Clean
-
▼
August
(
9
)
About Me
- Alain Rivas
-
A software / web developer by profession.
A Born-Again Christian by Faith.
A father of two (with one on the way).
A husband of one.
Once a radio disc jockey for eight years.
Now a geek glued to his computer.
0 comments:
Post a Comment