純真ip數(shù)據(jù)庫(kù)轉(zhuǎn)換為(access)使用圖文教程
發(fā)布時(shí)間:2010-04-20 09:42:25 作者:佚名
我要評(píng)論

有時(shí)候默認(rèn)的純真ip數(shù)據(jù)庫(kù)因?yàn)槌绦騿?wèn)題,需要轉(zhuǎn)換格式等,這里就簡(jiǎn)單的給大家演示一下,轉(zhuǎn)換方法。
第一步:其實(shí)制作查詢IP工具的時(shí)候,已經(jīng)有PHP可以完美直接讀取QQWry.Dat文件了,演示地址:http://tools.jb51.net/ip/index.php
源碼下載地址 PHP IP查詢系統(tǒng)(純真IP數(shù)據(jù)庫(kù)) v2.1
第二步:IPLook 1.5.exe就是可以將 QQWry.Dat 文件,轉(zhuǎn)出txt文件的軟件。(如果是看了腳本之家的文章來(lái)的朋友,下面的輸出格式,需要選擇IP以無(wú)符號(hào)整數(shù)表示)

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

其它的就很方便修改了
下面是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%> ] 來(lái) 自 : <%=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ù)庫(kù) 純真版 access(ip雙精度)數(shù)據(jù)庫(kù)制作工具
源碼下載地址 PHP IP查詢系統(tǒng)(純真IP數(shù)據(jù)庫(kù)) v2.1
第二步:IPLook 1.5.exe就是可以將 QQWry.Dat 文件,轉(zhuǎn)出txt文件的軟件。(如果是看了腳本之家的文章來(lái)的朋友,下面的輸出格式,需要選擇IP以無(wú)符號(hào)整數(shù)表示)

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

其它的就很方便修改了
下面是asp讀取access的代碼,注意字段的名稱需要簡(jiǎn)單的修改下
復(fù)制代碼
代碼如下:<%'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%> ] 來(lái) 自 : <%=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ù)庫(kù) 純真版 access(ip雙精度)數(shù)據(jù)庫(kù)制作工具
相關(guān)文章
職場(chǎng)人慌了! DeepSeek配合Mermaid自動(dòng)繪圖的技巧
DeepSeek這玩意兒,配合Mermaid,自動(dòng)生成甘特圖,這速度,這效率,簡(jiǎn)直了神奇了,下面我們就來(lái)看看用法2025-03-05建議收藏! 15 個(gè)很強(qiáng)的 DeepSeek 提示詞
今天匯總15個(gè)很值得收藏的DeepSeek 提示詞,包含職場(chǎng)打工人必備,自媒體爆款創(chuàng)作,學(xué)生黨逆襲,個(gè)人成長(zhǎng)開掛等等全方面2025-03-04如何在iPhone上部署DeepSeek-R1? DeepSeek-R1在手機(jī)上部署全攻略
你以為只在大機(jī)器上跑的模型,其實(shí)在手機(jī)上也能玩得轉(zhuǎn)!為了體驗(yàn)一下國(guó)產(chǎn)模型的魅力,我在蘋果手機(jī)上部署了DeepSeek-R1 1.5B版,詳細(xì)步驟如下2025-03-017天帶你從入門到精通! DeepSeek實(shí)操手冊(cè)建議收藏
我們之前分享了很多DeepSeek安裝及本地部署教程,今天我們來(lái)看看怎么馴化DeepSeek為自己服務(wù),下面我們就來(lái)看看DeepSeek 7天指導(dǎo)手冊(cè)2025-02-21手機(jī)端本地部署 Deepseek +桌面端 Deepseek 搭建知識(shí)庫(kù)指南
關(guān)于 Deepseek,這段時(shí)間也傳來(lái)不少新聞,本文將介紹如何在安卓手機(jī)和桌面設(shè)備上分別部署本地運(yùn)行的 Deepseek R1 模型,并搭建知識(shí)庫(kù),詳細(xì)如下文2025-02-21DeepSeek-R1 與 AnythingLLM 安裝部署本地知識(shí)庫(kù)詳細(xì)教程
DeepSeek R1是目前最火的大模型,近來(lái)有很多朋友問(wèn)怎么搭建DeepSeek 本地知識(shí)庫(kù),在這里分享一種使用DeepSeek + AnythingLLM快速搭建本地知識(shí)庫(kù)的方法,完全本地化,懶人必2025-02-20DeepSeek怎么獲取官方API? 一文教會(huì)你獲取DeepSeek官方API技巧
想要體驗(yàn)DeepSeek,該怎么貨期官方API呢?下面我們就來(lái)看看獲取DeepSeek官方API的詳細(xì)圖文教程2025-02-12DeepSeek怎么一秒生成工作表目錄? DeepSeek辦公自動(dòng)化的技巧
面對(duì)日益增長(zhǎng)的數(shù)據(jù)量和復(fù)雜多變的業(yè)務(wù)需求,傳統(tǒng)的Excel操作方式在效率和靈活性上逐漸顯露出不足,如果接入DeepSeek就可以補(bǔ)足缺陷,詳細(xì)請(qǐng)看下文介紹2025-02-12DeepSeek入門必備技巧與隱藏功能! DeepSeek新手使用指南
幾乎一夜之間,所有人都在關(guān)注DeepSeek,今天就來(lái)聊一聊DeepSeek,從什么是DeepSeek開始,到火爆原因,怎么下載使用,以及使用場(chǎng)合和隱藏功能分享,詳細(xì)如下2025-02-12DeepSeek卡頓延遲問(wèn)題怎么解決? 流暢使用DeepSeek的方法大全
由于deepseek人氣越來(lái)越高,讓越來(lái)越多人開始使用deepseek,另一方面由于前陣子登錄熱搜的外網(wǎng)網(wǎng)絡(luò)攻擊,導(dǎo)致用戶在使用時(shí)常常還沒(méi)說(shuō)幾句話,就出現(xiàn)服務(wù)器繁忙字樣,或使用2025-02-12