¡¡¡¡
ÔÚÍâÃ³ÍøÕ¾,ΪÁ˽ûֹͬÐгϮ£¬ËùÒÔ·ÀÖ¹Öйúip·ÃÎÊ·ÃÎÊ,·ÃÎʵÄʱºòÓÐÃÜÂëÌáʾ,ÕâÑù´úÂëÂëºÍ´ó¼Ò·ÖÏíÏÂ
index.asp
ÕâÊÇÄãÍøÒ³Õý³£ÏÔʾµÄÄÚÈÝ
chk.asp
<%
'[session("canRead") = "" or "OK" ] to judge it!
if Instr(getIPAddress(),"Öйú")>0 and session("canRead")="" then
response.Redirect("login.asp")
end if
Function leleToStr(str)
Dim stream
Set stream=Server.CreateObject("ADODB.Stream")
With stream
.Type=1
.Mode=3
.Open
.Write str
.Position = 0
.Type = 2
.Charset = "gb2312"
leleToStr = .ReadText
.Close
End With
Set stream=Nothing
End Function
'»ñÈ¡IPËùÔÚµØÇø
Function getIPAddress()
on error resume next
dim xmlhttp,url
url = "http://ip.qq.com"
set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
xmlhttp.open "get",url,false
xmlhttp.send
'¿ªÊ¼½ØÈ¡×Ö·û
dim StartStr,EndStr,html
html = leleToStr(xmlhttp.responseBody)
StartStr = Instr(html,"ËùÔÚµØÎª£º")
EndStr = Instr(html,"Èç¹û¸ÃIP")
html = mid(html,StartStr,EndStr-StartStr)
'ÔٴλñÈ¡
StartStr = Instr(html,"")
StartStr = StartStr + 6
EndStr = Instr(html,"")
html = mid(html,StartStr,EndStr-StartStr)
getIPAddress = html
if err then err.clear:html = ""
set xmlhttp = nothing
End Function
%>
login.asp
<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then
if trim(request("pass"))="blueidea" then
session("canRead")="OK"
response.Redirect("index.asp")
else
response.Write("ÃÜÂë´íÎ󣬷µ»ØÖØÊÔ£¡")
response.End()
end if
end if
%>
³ÌÐò´ò°üÏÂÔØ
/UpFile/201211/2012110479480577.rar
µ÷ÓõĴ¿ÕæÔÚÏßÊý¾Ý¿â£¡