📄 blogdata.asp
字号:
<%
startime=timer()
db="sxblog.mdb" '数据库地址
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
%>
<%
dim ipconn,stop_ip,un_ip,rs_ip
un_ip=0
set ipconn=Server.CreateObject("ADODB.Connection")
ipconn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
stop_ip= Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If stop_ip="" Then stop_ip= Request.ServerVariables("REMOTE_ADDR")
call ynip(stop_ip)
if un_ip=0 then
set rs_ip=ipconn.execute("select viw From stopip where viw<>0 and ("& cip(stop_ip) &" between oneip and endip)",0,1)
if not rs_ip.eof then
if rs_ip("viw")=1 then Response.write"BLOG维护中.<br>"
if rs_ip("viw")=2 then Response.write"你的IP地址已经被封,禁止访问本站.<br>"
rs_ip.close
set rs_ip=nothing
ipconn.close
set ipconn=nothing
Response.end
end if
rs_ip.close
set rs_ip=nothing
end if
sub ynip(uip)
dim tip
tip = split(uip,".")
if not IsArray(tip) then un_ip=1
if UBound(tip)<3 then un_ip=1
if Not IsNumeric(tip(0)) or Not IsNumeric(tip(1)) or Not IsNumeric(tip(2)) or Not IsNumeric(tip(3)) then un_ip=1
if cint(tip(0))>255 or cint(tip(1))>255 or cint(tip(2))>255 or cint(tip(3))>255 then un_ip=1
end sub
function cip(sip)
dim tip
'tip=cstr(sip)
'sip1=left(tip,cint(instr(tip,".")-1))
'tip=mid(tip,cint(instr(tip,".")+1))
'sip2=left(tip,cint(instr(tip,".")-1))
'tip=mid(tip,cint(instr(tip,".")+1))
'sip3=left(tip,cint(instr(tip,".")-1))
'sip4=mid(tip,cint(instr(tip,".")+1))
'if cint(sip1)<128 then
'cip=cint(sip1)*256*256*256+cint(sip2)*256*256+cint(sip3)*256+cint(sip4)
'else
'cip=cint(sip1)*256*256*256+cint(sip2)*256*256+cint(sip3)*256+cint(sip4)-4294967296
'end if
tip = split(sip,".")
if cint(tip(0))<128 then
cip=cint(tip(0))*256*256*256+cint(tip(1))*256*256+cint(tip(2))*256+cint(tip(3))
else
cip=cint(tip(0))*256*256*256+cint(tip(1))*256*256+cint(tip(2))*256+cint(tip(3))-4294967296
end if
end function
ipconn.close
set ipconn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -