主页 > 知识库 > 做了CDN加速的ASP网站获取用户真实IP程序

做了CDN加速的ASP网站获取用户真实IP程序

热门标签:梧州市地图标注 java外呼系统是什么 济源电销外呼系统线路 石家庄慧营销外呼系统 武穴地图标注 地图标注阳江 外呼线路批发 创意电话机器人 世界地图标注了哪些城市
复制代码 代码如下:

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
您可能感兴趣的文章:
  • 做了CDN获取用户真实IP的函数代码(PHP与Asp设置方式)
  • asp 取得用户真实IP,对代理地址仍然有效的函数
  • ASP如何获取真实IP地址

标签:滁州 迪庆 淮北 揭阳 南宁 来宾 甘南 唐山

巨人网络通讯声明:本文标题《做了CDN加速的ASP网站获取用户真实IP程序》,本文关键词  做了,CDN,加速,的,ASP,网站,;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 下面列出与本文章《做了CDN加速的ASP网站获取用户真实IP程序》相关的同类信息!
  • 本页收集关于做了CDN加速的ASP网站获取用户真实IP程序的相关信息资讯供网民参考!
  • 推荐文章