ASP. NET (C #) uses QQ's IP database qqwry. dat for precise IP address query
First download the latest IP database qqwry. dat
Search for the latest qqwry. dat on Google
Http://www.google.com/search? Hl = ZH-CN & newwindow = 1 & Q = IP % E6 % 95% B0 % E6 % 8d % AE + qqwry & btng = % E6 % 90% 9C % E7 % B4 % A2 & LR =
Download iplocation. dll
Address: http://www.iwcn.net/attachments/month_0612/g200612161210.rar
Add reference in project to reference iplocation. dll
Add reference: Using iplocation. iplocation;
Key functions:
Iplocate (byval strconn as string, byval strip as string)
Strconn indicates the database connection string, for example, server. mappath ("qqwry. dat ")
Strip is the Query IP Address
The returned value is a string type and an IP address.
Example:
Put qqwry. dat in the root directory of the website.
String Conn, ipstr, addstr;
Conn = server. mappath ("qqwry. dat ");
Ipstr = textbox1.text;
Addstr = iplocation. iplocation. iplocate (Conn, ipstr );
Label1.text = "IP:" + ipstr + "<br> address:" + addstr;
Http://www.cnblogs.com/llainn/articles/1087667.html
Http://www.cnblogs.com/hjf1223/archive/2008/06/19/QQWry_net.html