网络编程
位置:首页>> 网络编程>> Asp编程>> 如何隐藏IP地址的最后一位

如何隐藏IP地址的最后一位

  发布时间:2011-04-04 16:38:00 

标签:ip,隐藏

首先获取ip:


<%
    userip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
    If userip="" Then 
    userip=Request.ServerVariables("REMOTE_ADDR")
    end If
%>

第一种方法:用Split()函数


<%
    myip=Split(userip,".")
    response.write myip(UBound(myip))&"<br />"
    response.write myip(0)&"."&myip(1)&"."&myip(2)&"."&"*"
%>

第二种:用Left()和InstrRev()函数

<%
    response.write Left(userip,InstrRev(userip,"."))&"*"&"<br />"
%>

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com