国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

做了CDN加速的ASP網站獲取用戶真實IP程序

2020-07-27 12:50:17
字體:
來源:轉載
供稿:網友
復制代碼 代碼如下:

function checkip(checkstring)'用正則判斷IP是否合法
dim re1
set re1=new RegExp
re1.pattern="^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"
re1.global=false
re1.Ignorecase=false
checkip=re1.test(checkstring)
set re1=nothing
end function

復制代碼 代碼如下:

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 then
get_cli_ip = checkip(Request.ServerVariables("HTTP_CLIENT_IP"))
else
MyArray = split(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),",")
if ubound(MyArray)>=0 then
client_ip = trim(MyArray(0))
if checkip(client_ip)=true then
get_cli_ip = client_ip
exit function
end if
end if
get_cli_ip = Request.ServerVariables("REMOTE_ADDR")
end if
end function
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 泉州市| 崇阳县| 四平市| 同德县| 武清区| 柏乡县| 宣恩县| 漾濞| 汽车| 元氏县| 耒阳市| 石景山区| 林西县| 和龙市| 焉耆| 兰溪市| 光山县| 抚顺县| 渭源县| 子洲县| 内乡县| 杂多县| 盐亭县| 土默特右旗| 常德市| 探索| 米脂县| 河间市| 吴堡县| 长武县| 化隆| 灵石县| 富阳市| 交城县| 荔波县| 崇阳县| 德保县| 新平| 额敏县| 杭州市| 青浦区|