asp实现*号隐藏IP地址
来源:asp之家 时间:2008-08-10 18:51:00
我们经常见到很多网站留言系统的显示访客的IP地址都是隐藏了一部分,以达到隐蔽访客真实地理位置的功能。如:111.222.333.*,当然在系统后台管理员看到的是完整的IP记录,只是前台显示时隐藏掉了一部分。
那么我们用asp改这么实现这个功能呢?
方法一:使用split函数
其实很简单,我们知道IP地址是以三个.分割的字符串,我们只要提取前两个. 左右的数字就可以了:
<%
ip=rs("ip")'这里读取完整的IP地址
ip=split(ip,".")
for j=0 to 1
response.Write ip(j)&"."
next
response.Write("*.*")
%>
方法二:自定义函数
Function ReplaceIP(ip)
Dim l
l=InstrRev(ip,".")+1
ReplaceIP=mid(IP,1,l-1)&"*"
End Function
IP="203.132.61.56" '这里读取IP地址
Response.write ReplaceIP(ip)
'屏幕将显示:203.132.61.*
标签:ip,地址,隐藏,asp
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
解决python删除文件的权限错误问题
2023-09-06 07:33:36
SQL Server索引超出了数组界限的解决方案
2024-01-12 19:14:41
![](https://img.aspxhome.com/file/2023/7/89647_0s.jpg)
Python 文件操作方法总结
2023-11-29 11:36:28
pytorch教程网络和损失函数的可视化代码示例
2023-11-26 16:13:51
![](https://img.aspxhome.com/file/2023/0/91970_0s.png)
微信公众平台开发——群发信息
2023-05-19 16:18:48
![](https://img.aspxhome.com/file/2023/1/112091_0s.png)
基于numpy中的expand_dims函数用法
2023-02-25 23:24:20
![](https://img.aspxhome.com/file/2023/4/110194_0s.jpg)
python通过socket实现多个连接并实现ssh功能详解
2022-06-08 20:50:56
![](https://img.aspxhome.com/file/2023/4/135334_0s.png)
微信小程序MUI导航栏透明渐变功能示例(通过改变rgba的a值实现)
2024-05-11 09:42:52
![](https://img.aspxhome.com/file/2023/5/125945_0s.gif)
Sql Server表死锁的解决方法分享
2011-09-01 19:08:00
兼容主流浏览器,纯CSS下拉菜单
2010-09-05 20:30:00
JavaScript的eval JSON object问题
2024-05-09 10:33:59
GO语言基础之数组
2024-03-11 21:44:03
![](https://img.aspxhome.com/file/2023/7/107347_0s.png)
基于OpenCV(python)的实现文本分割之垂直投影法
2023-11-17 08:45:39
![](https://img.aspxhome.com/file/2023/9/64319_0s.png)
python使用rsa加密算法模块模拟新浪微博登录
2022-06-04 13:36:19
PyTorch如何创建自己的数据集
2022-10-17 05:22:17
![](https://img.aspxhome.com/file/2023/1/90281_0s.png)
通过Python 获取Android设备信息的轻量级框架
2021-08-18 21:41:00
MySQL学习第三天 Windows 64位操作系统下验证MySQL
2024-01-22 20:19:39
![](https://img.aspxhome.com/file/2023/9/112859_0s.png)
layerUI下的绑定事件实例代码
2024-04-16 09:38:08
简化SQL Server备份与还原到云工作原理及操作方法
2024-01-18 14:27:36
![](https://img.aspxhome.com/file/2023/2/91202_0s.png)
Python Django中的STATIC_URL 设置和使用方式
2021-08-07 13:39:06