Escribí el Código de ASP para tomar la IP real, y no hay agente, primero o agente de nivel múltiple con pruebas ambientales.
Función checkip (checkstring) 'Use regularmente para determinar si IP es legal
Dim RE1
establecer RE1 = nuevo regexp
Re1.pattern =^[0-9] {1,3}.
Re1.global = falso
Re1.ignorecase = false
Checkip = re1.test (checkstring)
establecer RE1 = nada
función final
Función get_cli_ip () 'para tomar la función IP real, primero http_client_ip y luego http_x_forwardeded_for y luego remoto_addr
Dim Client_IP
if checkip (request.servervariables (http_client_ip)) = true entonces
get_cli_ip = checkip (request.servervariables (http_client_ip)))
demás
MyArray = Split (request.ServerVariAbles (http_x_forwarded_for) ,,)
Si Ubound (myArray)> = 0 entonces
client_ip = trim (myArray (0))
Si checkip (client_ip) = true entonces
get_cli_ip = client_ip
función de salida
final si
final si
get_cli_ip = request.ServerVariAbles (remota_addr)
final si
función final