Find Visitor Geographical location from IP address using ASP
来源:互联网 发布:爱养成狼族女王数据 编辑:程序博客网 时间:2024/05/02 19:46
Find Visitor Geographical location from IP address using ASP
http://www.codetoad.com/asp_geoip.aspDownload GeoIP files - 6 Kb
Online Demo
Introduction
With GeoIP you can detect where your visitors are coming from. You can use this information to deliver personalized information (see image below), reducing credit card fraud, analyzing web server logs (I use it for SNIFF), target banner ads, .... (see Solutions at MaxMind - http://www.maxmind.com/)
Click on the image for a test
Note
If you can install a component on your web server, you should download the GeoIP component from MaxMind . I wrote GeoIP.asp since my provider doesn't allow me to install components.
Prerequisite
You need the GeoIP database - http://www.maxmind.com/app/free, and you need ADO 2.5 or later since GeoIP.asp uses the ADO Stream object to read the GeoIP database.
Installation
Download the GeoIP.dat database from MaxMind http://www.maxmind.com/app/free Put GeoIP.asp, example.asp and GeoIP.dat in a catalog on your web server. Test the installation by accessing the example.asp page http://yourserver/path/example.asp
Methods and Properties
GeoIP.asp exposes these public methods and properties
Properties:
GeoIPDataBase
- Sets the path and filename to GeoIP.dat ErrNum - Returns the error number (if <> 0, there's an error) Methods:
lookupCountryName
- Find an IP's country name example: strCountryName = oGeoIP.lookupCountryName(strIP)
lookupCountryCode
- Find an IP's country code example: strCountryCode = oGeoIP.lookupCountryCode(strIP)
Using the code
It's rather simple to use this code:
- Find Visitor Geographical location from IP address using ASP
- Find Guest IP address using QEMU Guest Agent
- Find the visitor from the whole earth
- How to set IP address using Qt
- Get ip address from an interface name
- get my ip address from curl
- find ip from hostname or find hostname from ip
- Android: How to get Address from geolocation using Geocoder
- Get IP Address using PHP(Accurate Method)
- Notice me about server's IP address using github
- How to Find Your IP Address in Ubuntu Linux
- Configure IP Address and DNS from Command Line
- Email address validation using ASP.NET MVC data type attributes
- Find me if you can:improving geographical...(2013.9.27)
- Displaying the Location Address
- IP address
- ip address
- IP Address
- ASP Format Date and Time Script
- testtesttest
- Creating CSS Buttons
- Simple Thumbnail Solution
- 何为DMZ区
- Find Visitor Geographical location from IP address using ASP
- 听说过MOFUN吗?一种新的手机上开发类型,据说 比JAVA的还要好?!
- 什么样的恐怖才是真恐怖?由最近所看的一部电影以及最喜欢的游戏系列想到的。
- Communicating with the Database (Using ADO)
- QUESTION NO: 146
- DHTML Zoom In and Out Script
- nhibernate配置和持久对象映射文件
- apache note | Apache 学习笔记(心得) by Emerald 绿色学院 - Green Institute
- DLL的Export和Import