第一步:其實(shí)制作查詢IP工具的時(shí)候,已經(jīng)有PHP可以完美直接讀取QQWry.Dat文件了,演示地址:http://tools.VeVB.COm/ip/index.php
源碼下載地址 PHP IP查詢系統(tǒng)(純真IP數(shù)據(jù)庫) v2.1
第二步:IPLook 1.5.exe就是可以將 QQWry.Dat 文件,轉(zhuǎn)出txt文件的軟件。(如果是看了武林網(wǎng)的文章來的朋友,下面的輸出格式,需要選擇IP以無符號(hào)整數(shù)表示)

第三步:將剛導(dǎo)出的txt文件轉(zhuǎn)成數(shù)據(jù)庫的工具

其它的就很方便修改了
下面是asp讀取access的代碼,注意字段的名稱需要簡(jiǎn)單的修改下
<%'IP
Public Function address(sip)
Dim aConnStr,aConn,adb
Dim str1,str2,str3,str4
Dim num
Dim country,city
Dim irs,SQL
If IsNumeric(Left(sip,2)) Then
If sip="127.0.0.1" Then sip="192.168.0.1"
str1=Left(sip,InStr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str2=Left(sip,instr(sip,".")-1)
sip=Mid(sip,InStr(sip,".")+1)
str3=Left(sip,instr(sip,".")-1)
str4=Mid(sip,instr(sip,".")+1)
If isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 Then
Else
num=CLng(str1)*16777216+CLng(str2)*65536+CLng(str3)*256+CLng(str4)-1
adb = "ip.mdb"
aConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(adb)
Set AConn = Server.CreateObject("ADODB.Connection")
aConn.Open aConnStr
sql="select * from ip where startip <="&num&" and endip >="&num&""
Set irs=aConn.execute(sql)
If irs.EOF And irs.bof Then
local="尚未收錄"
Else
local=irs("country")&irs("local")
End If
Set irs=Nothing
Set aConn = Nothing
SqlQueryNum = SqlQueryNum+1
End If
address=local
Else
address="未知"
End If
End Function
linkip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If linkip = "" Then linkip = Request.ServerVariables("REMOTE_ADDR")
ip=request.form("ip")
%>
<dd style="text-align:center"><span class="bot">+ + 您 的 IP : [ <%=linkip%> ] 來 自 : <%=address(linkip)%> + +
<%=Request.ServerVariables("HTTP_USER_AGENT")%></span>
<form method="post" target="_top" action="ip.asp" name="ipform" onsubmit="return checkIP();">
請(qǐng)輸入要查詢的IP:
<input type="text" name="ip" size="36" value="<%=ip%>" class=input> <input type="submit" value="點(diǎn)擊查詢" class=but></form>
<%
if request.ServerVariables("REQUEST_METHOD")="POST" then%>
<font color="#ff0000"><strong>查詢結(jié)果 : <%=ip%> ==>> <%=ip%> ==>> <%=address(ip)%></strong></font>
上面四項(xiàng)依次顯示的是 : 原始輸入內(nèi)容 <strong>==>></strong> 獲取的IP地址 <strong>==>></strong> IP的物理位置
<%end if%>
文中所用工具打包下載 QQ IP數(shù)據(jù)庫 純真版 access(ip雙精度)數(shù)據(jù)庫制作工具