当前位置: 移动技术网 > IT编程>开发语言>.net > 把IP表存入SQL里的程序

把IP表存入SQL里的程序

2019年01月13日  | 移动技术网IT编程  | 我要评论

渤梁,潜入大脑的两百条虫,英语六级评分标准

写得比较粗糙,还有一点错误,不过能达到效果,凑合着用了,是4266条,不知道对也不对

create.
-----------------------------------------------------------------------
<%
option explicit
server.scripttimeout = 1000
on error resume next

define your sql info here
strsqldsn = "xxxx"
strsqlusername = "sa"
strsqlpassword = ""

this is where we connect to our sql server(windows平台上强大的平台)
set adoconn = server.createobject("adodb.connection")
connectionstring = "dsn=" & strsqldsn & ";uid=" & strsqlusername & ";pwd=" & strsqlpassword & ""
adoconn.open connectionstring
set adors = server.createobject("adodb.recordset")

get sql from ip.txt
set fso = server.createobject("scripting.filesystemobject")
    if fso.fileexists(server.mappath("ip.txt")) then
       set a = fso.opentextfile(server.mappath("ip.txt"), 1, false)
           do while a.atendofstream <> true
              sql = a.readline
              adoconn.execute (sql)
           loop
       a.close
       set a = nothing
    else
    response.write "文件没找到"
    response.end
    end if
set fso = nothing

error handle
if err.number <> 0 then
           
            this code come from
           strmsg = strmsg + "********************************************" + vbcrlf
           strmsg = strmsg + "错误时间:" + cstr(now()) + vbcrlf
           strmsg = strmsg + "错误类型:err错误"        + vbcrlf
           strmsg = strmsg + "错误号  :" + cstr(err.number) + vbcrlf
           strmsg = strmsg + "错误源  :" + err.source   + vbcrlf
           strmsg = strmsg + "错误描述:" + err.description + vbcrlf
           strmsg = strmsg + "*********************************************" + vbcrlf

           strlogmsg = strlogmsg + "*****************************************" + vbcrlf
           strlogmsg = strlogmsg + "错误时间:" + cstr(now()) + vbcrlf
           strlogmsg = strlogmsg + "错误类型:err错误" + vbcrlf

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网