28,406
社区成员
发帖
与我相关
我的任务
分享myip = request.ServerVariables("REMOTE_ADDR")
if hour(now())>=8 and hour(now()) <11 and IP2Int(myip)>=IP2Int("192.168.1.0") and IP2Int(myip)>=IP2Int("192.168.1.255") then
'Your Code
end if
Function IP2Int(IP)
Dim IPArray,i
IPArray=Split(IP,".",-1)
FOr i=0 to 3
If Not IsNumeric(IPArray(i)) Then IPArray(i)=0
If CInt(IPArray(i))<0 Then IPArray(i)=Abs(CInt(IPArray(i)))
If CInt(IPArray(i))>255 Then IPArray(i)=255
Next
IP2Int=(CInt(IPArray(0))*256*256*256)+(CInt(IPArray(1))*256*256)+(CInt(IPArray(2))*256)+CInt(IPArray(3))'-1
End Function
IF CheckIp(getIP(),"192.168.1.0~192.168.2.255:允许") and hour(now())>=8 and hour(now()) <11 then
Response.Redirect "error.htm"
end if