나는 실제 IP를 취하기 위해 ASP 코드를 작성했으며, 환경 테스트를받을 수있는 첫 번째 또는 다중 레벨 에이전트가 없습니다
함수 checkip (checkstring) '정기적으로 사용하여 IP가 합법적인지 확인
Dim Re1
RE1 = New Regexp를 설정합니다
re1.pattern =^[0-9] [0-9] {1,3}
re1.global = false
re1.ignorecase = false
checkip = re1.test (checkstring)
RE1 = 아무것도 설정하지 않습니다
엔드 기능
function get_cli_ip () '실제 IP 함수, 먼저 http_client_ip 및 http_x_forwarded_for 및 remote_addr
dim client_ip
if checkip (request.servervariables (http_client_ip)) = true
get_cli_ip = checkip (request.servervariables (http_client_ip))
또 다른
myArray = split (request.servervariables (http_x_forwarded_for) ,,)
Ubound (myArray)> = 0 인 경우
client_ip = trim (myArray (0))
checkip (client_ip) = true 인 경우
get_cli_ip = client_ip
종료 기능
끝 If
끝 If
get_cli_ip = request.servervariables (remote_addr)
끝 If
엔드 기능