Função de limite de filtragem para IP em ASP
<%
'Obtenha o endereço do visitante
ip = request.servervariables ("remote_addr")
'Os segmentos de endereço IP permitidos são 10.0.0.0 ~ 10.68.63.255
permitir1 = "10.0.0.0"
allowip2 = "10.68.10.71"
Response.Writecheckip (IP, Allowip1, Allowip2)
FunctionCheckip (IP, Allowip1, Allowip2)
Dimcheck (4)
checkip = false
ipstr = split (ip, ".")
ALIME1 = SPLIT (allowip1, ".")
permiss2 = split (allowip2, ".")
ifcint (allow1 (0))> cint (allow2 (0)) então
'Apenas determine se o segmento de endereço IP é legal
Response.Write "Há um erro no segmento de endereço IP!"
saída de saída
endif
fori = 0toubund (ipstr)
ifcint (allow1 (i)) <cint (allow2 (i)) então
ifcint (allow1 (i)) = cint (ipstr (i)) então
Verifique (i) = true
checkip = true
exitfor
elseifcint (ipstr (i)) <cint (allow2 (i)) então
Verifique (i) = true
checkip = true
exitfor
elseifcint (ipstr (i))> cint (allow2 (i)) então
Verifique (i) = false
checkip = false
exitfor
outro
Verifique (i) = true
checkip = true
endif
endif
endif
elseifcint (allow1 (i))> cint (ipstr (i)) orcint (allow1 (i)) <cint (ipstr (i)) então
Verifique (i) = false
checkip = false
ifi <> ubund (ipstr) então
exitfor
endif
outro
Verifique (i) = true
endif
endif
próximo
if (check (0) = TrueArndCheck (1) = TrueArndCheck (2) = TrueArndCheck (3) = false) e (cint (allow2 (2))> cint (ipstr (2))) então
checkip = true
endif
Função final
%>
<%
'Enum todos os valores enviados usando o formulário HTML
ForeachIteminRequest.form
Response.WriteReQuest.form (item)
Próximo
%>
Liste todos os valores enviados usando formulários HTML
Use ASP para obter o tamanho da imagem
<%
imgpath = "default_22.gif"
setpp = newImginfo
w = pp.imgw (server.mappath (imgpath))
h = pp.imgh (server.mappath (imgpath))
setpp = nada
Response.Write "<imgsrc = '" & imgpath & "Border = 0> <br> Largura:" & w & "; alta:" & h
Classimginfo
DIMASO
Privatesubclass_initialize
setaso = createObject ("adodb.stream")
ASO.MODE = 3
ASO.TYPE = 1
ASO.OPEN
Endsub
Privatesubclass_termine
err.clear
setaso = nada
Endsub
PrivateFunctionBin2STR (BIN)
Dimi, str