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

首頁 > 編程 > ASP > 正文

做了CDN加速的ASP網(wǎng)站獲取用戶真實IP程序

2024-05-04 11:06:42
字體:
來源:轉載
供稿:網(wǎng)友

代碼如下:
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函數(shù),先 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

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 晋宁县| 双江| 芒康县| 台安县| 昭平县| 宝丰县| 龙海市| 舞钢市| 镇雄县| 长兴县| 舒兰市| 玛多县| 乐清市| 磴口县| 定襄县| 莱芜市| 抚松县| 五寨县| 河津市| 大化| 鄢陵县| 绥中县| 牙克石市| 云浮市| 新邵县| 衡东县| 阳曲县| 容城县| 文水县| 宣恩县| 鹤山市| 毕节市| 赞皇县| 子长县| 喀什市| 任丘市| 汾西县| 东明县| 三都| 长沙县| 屏东县|