网页怎么样实现打开一个通知!按不同IP地址段访问对应显示不同的通知?
来源:百度知道 编辑:UC知道 时间:2024/07/02 06:42:47
在上级站的网页中添加代码获取访问者的IP地址,然后消息提示。参考下面代码
*******************************************************************
'取得IP地址
'*******************************************************************
Function Userip()
Dim GetClientIP
'如果客户端用了代理服务器,则应该用ServerVariables("HTTP_X_FORWARDED_FOR")方法
GetClientIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If GetClientIP = "" or isnull(GetClientIP) or isempty(GetClientIP) Then
'如果客户端没用代理,应该用Request.ServerVariables("REMOTE_ADDR")方法
GetClientIP = Request.ServerVariables("REMOTE_ADDR")
end if
Userip = GetClientIP
End function
'*******************************************************************
'转换IP地址
'*******************************************************************
function cip(sip)
tip=cstr(sip)
sip1=left(tip,cint(instr(ti