无为清净楼资源网 Design By www.qnjia.com
纯真ip数据库转动网数据库ASP脚本
去纯真网站上下载ip数据库,同时随数据库附送的查询程序(Showip.exe)具有在线检测并升级IP数据库的功能,只要运行该程序,点击右上角的
“在线升级”,就可以升级IP数据库到最新的版本,无需再到下载网站下载新版的IP数据库。
同时查询程序(Showip.exe)还提供了解压为.txt文件的功能:)
我们就借助这一功能实现转MDB格式的数据库。
第一步:打开查询程序(Showip.exe),点击解压
第二步:保存导出的数据文本为ipaddress.txt,提示成功后,确定关闭。
第三步:新建一个MDB文件,命名为ipaddress.mdb,点击打开,使用Access提供的导入文本文件的功能,把刚才导出的ipaddress.txt导入到数据库中。
第四步:导入文本向导:
1、选择[带分隔符-用逗号或制表符之类的符号分隔每个字段]选项
2、下一步:选择空格作为分隔符;
3、下一步:新表中;
4、下一步:第一字段,不做任何修改,默认下一步;
5、下一步:定义主键:选择不要主键;
6、下一步:默认ipaddress表名,完成。
第五步:建立动网格式的数据表ipaddress2
id 自动编号(可以不要)
ip1 双精度数据
ip2 双精度数据
country 文本 100字节
city 文本 255字节
关闭数据库。
第六步:在ASP环境下运行ip.ASP
第七步:此时的数据库非常大,为了能够小一些:(,建立一个新的空数据库,把原数据库中ipadress2导入。$
以后的应用我就不说了。~~~
重要的脚本部分:
复制代码 代码如下:
<%
Server.ScriptTimeOut=999
min=0 ''开始数
max=260262''结束数 数据数量-1
Dim Conn
Set Conn= Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=01;Data Source="& Server.MapPath("ipaddress.mdb")
Conn.Open
If Err Then
Err.Clear
Set Conn = Nothing
Response.Write("<head><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"" /><title>数据库连接出错,请检查连接字串</title></head><body><div align=""center"" style=""width:400px;height:100px;padding: 8px;font-size:9pt;border: 1px solid ThreeDShadow;POSITION:absolute;top:expression((document.body.offsetHeight-100)/2);left:expression((document.body.offsetWidth-400)/2);""><table width=""100%"" height=""100%"" style=""font-size:12px;font-family:Tahoma;""><tr><td align=""center""><strong>数据库连接出错,请检查连接字串</strong></td></tr></table></div></body>")
Response.End
End If
set rs=conn.execute("select * from [ipaddress]")
if not rs.eof then
first=rs.GetRows()
for j=0 to 261501
z=""
local=""
for i=0 to 16
if len(first(i,j))>0 then
z=first(i,j)&"$$"&z
end if
next
zz=split(z,"$$")
startip=enaddr(zz(ubound(zz)-1))
endip=enaddr(zz(ubound(zz)-2))
country=zz(ubound(zz)-3)
for zzz=0 to ubound(zz)-4
local=zz(zzz)&" "&local
next
local=replace(local,"'","''")
'response.write "startip:"&startip&"<br>endip:"&endip&"<br>country:"&country&"<br>local:"&local&"<br><br>"
conn.execute("insert into [ipaddress2] (ip1,ip2,country,[city]) values ("&startip&","&endip&",'"&country&"','"&local&"')")
next
end if
conn.execute("update [ipaddress2] set [city]='--' where [city]='CZ88.NET' ")
response.write "升级成功!"
function enaddr(sip)
esip=cstr(sip)
str1=Left(sip,CInt(InStr(sip,".")-1))
sip=Mid(sip,cint(instr(sip,"."))+1)
str2=Left(sip,cint(instr(sip,"."))-1)
sip=mid(sip,cint(instr(sip,"."))+1)
str3=left(sip,cint(instr(sip,"."))-1)
str4=mid(sip,cint(instr(sip,"."))+1)
enaddr=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
end function
%>
去纯真网站上下载ip数据库,同时随数据库附送的查询程序(Showip.exe)具有在线检测并升级IP数据库的功能,只要运行该程序,点击右上角的
“在线升级”,就可以升级IP数据库到最新的版本,无需再到下载网站下载新版的IP数据库。
同时查询程序(Showip.exe)还提供了解压为.txt文件的功能:)
我们就借助这一功能实现转MDB格式的数据库。
第一步:打开查询程序(Showip.exe),点击解压
第二步:保存导出的数据文本为ipaddress.txt,提示成功后,确定关闭。
第三步:新建一个MDB文件,命名为ipaddress.mdb,点击打开,使用Access提供的导入文本文件的功能,把刚才导出的ipaddress.txt导入到数据库中。
第四步:导入文本向导:
1、选择[带分隔符-用逗号或制表符之类的符号分隔每个字段]选项
2、下一步:选择空格作为分隔符;
3、下一步:新表中;
4、下一步:第一字段,不做任何修改,默认下一步;
5、下一步:定义主键:选择不要主键;
6、下一步:默认ipaddress表名,完成。
第五步:建立动网格式的数据表ipaddress2
id 自动编号(可以不要)
ip1 双精度数据
ip2 双精度数据
country 文本 100字节
city 文本 255字节
关闭数据库。
第六步:在ASP环境下运行ip.ASP
第七步:此时的数据库非常大,为了能够小一些:(,建立一个新的空数据库,把原数据库中ipadress2导入。$
以后的应用我就不说了。~~~
重要的脚本部分:
复制代码 代码如下:
<%
Server.ScriptTimeOut=999
min=0 ''开始数
max=260262''结束数 数据数量-1
Dim Conn
Set Conn= Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=01;Data Source="& Server.MapPath("ipaddress.mdb")
Conn.Open
If Err Then
Err.Clear
Set Conn = Nothing
Response.Write("<head><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"" /><title>数据库连接出错,请检查连接字串</title></head><body><div align=""center"" style=""width:400px;height:100px;padding: 8px;font-size:9pt;border: 1px solid ThreeDShadow;POSITION:absolute;top:expression((document.body.offsetHeight-100)/2);left:expression((document.body.offsetWidth-400)/2);""><table width=""100%"" height=""100%"" style=""font-size:12px;font-family:Tahoma;""><tr><td align=""center""><strong>数据库连接出错,请检查连接字串</strong></td></tr></table></div></body>")
Response.End
End If
set rs=conn.execute("select * from [ipaddress]")
if not rs.eof then
first=rs.GetRows()
for j=0 to 261501
z=""
local=""
for i=0 to 16
if len(first(i,j))>0 then
z=first(i,j)&"$$"&z
end if
next
zz=split(z,"$$")
startip=enaddr(zz(ubound(zz)-1))
endip=enaddr(zz(ubound(zz)-2))
country=zz(ubound(zz)-3)
for zzz=0 to ubound(zz)-4
local=zz(zzz)&" "&local
next
local=replace(local,"'","''")
'response.write "startip:"&startip&"<br>endip:"&endip&"<br>country:"&country&"<br>local:"&local&"<br><br>"
conn.execute("insert into [ipaddress2] (ip1,ip2,country,[city]) values ("&startip&","&endip&",'"&country&"','"&local&"')")
next
end if
conn.execute("update [ipaddress2] set [city]='--' where [city]='CZ88.NET' ")
response.write "升级成功!"
function enaddr(sip)
esip=cstr(sip)
str1=Left(sip,CInt(InStr(sip,".")-1))
sip=Mid(sip,cint(instr(sip,"."))+1)
str2=Left(sip,cint(instr(sip,"."))-1)
sip=mid(sip,cint(instr(sip,"."))+1)
str3=left(sip,cint(instr(sip,"."))-1)
str4=mid(sip,cint(instr(sip,"."))+1)
enaddr=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
end function
%>
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年09月20日
2024年09月20日
- 《腾格尔 容中尔甲 亚东 高原三星 男人篇 3CD》[WAV/分轨][1GB]
- 命运圣契公测实测可用兑换码大全 命运圣契最新兑换码分享
- 黑神话悟空上品疾蝠精魄获取方法一览|上品疾蝠精魄收集攻略
- 《七龙珠电光炸裂!ZERO》GT角色预告片曝光,15位新角色登场
- [ABC]安娜-胆麦发烧女声[6N纯银镀膜][2016[低速原抓WAV+CUE]
- NewViennaOctetViennaWindSoloists-TheDeccaRecordings(2024)18CD[24-48][FLAC]-7
- 雨果唱片-三角琴《俄罗斯民间音乐系列-梁祝(中国名曲)》wav
- 《塞尔达传说:智慧的再现》新实机!无之世界介绍
- 任天堂公布《塞尔达传说》系列时间线:野炊与王泪独立在外
- 任天堂更新网络投稿规范:打击影响他人游戏体验行为
- 冼佩瑾.2024-女儿Daughter(EP)【杰威尔】【FLAC分轨】
- 黑豹乐队.1993-光芒之神【摇音晨【WAV+CUE】
- 曾轶可.2011-一只猫的旅行【天娱传媒】【WAV+CUE】
- 黑神话悟空上品狼刺客精魄获取方法一览|上品狼刺客精魄收集攻略
- 视觉小说《神椿市建设中REGENERATE》将于2025年2月20日发售