当前位置:首页 » 密码管理 » 获取访问者ipasp

获取访问者ipasp

发布时间: 2023-06-15 18:14:14

❶ asp中怎样获取访问者的IP地址

ip = request.servervariables("remote_addr") '获取访问者的ip
now_time = now '获取登陆时间(服务器时间)

完整的代码如下
dim
conn,rs,ip,now_time
set
conn=server.createobject("adodb.connection")
dbpath =
server.mappath("数据库路径")
conn.open "driver={microsoft access driver
(*.mdb)};dbq=" & dbpath
set
rs=server.createobject("adodb.recordset")
sql = "表名"
rs.open
sql,conn,3,2
rs.addnew
ip = request.servervariables("remote_addr")
'获取访问者的ip
now_time = now '获取登陆时间(服务器时间)
rs("字段名1") = ip
rs("字段名2") = now_time
rs.update

❷ ASP怎么查看在线访问者的IP地址

分类: 电脑/网络 >> 程序设计 >> 其他编程语言
问题描述:

访问者访问一个蠢含IP。ASP文件,能获得他的IP,而我们能同时从另外一个页面LOADIP。ASP文件看到他的IP,这段代码要怎么写呀,我写了出来能获得IP,但是就是我们不能同时从另外一个颤笑页面看到访问者的IP,哪位大侠能教教我!

IP。ASP 代码

<% Application.Lock()

Application("Userip") = Request.ServerVariables("HTTP_X_FORWARDED_FOR")

If Application("Userip") = "" Then Application("Userip") = Request.ServerVariables("REMOTE_ADDR")

Session("Userip")=Application("Userip")

Application.UnLock()

Response.Redirect("loadip")

%>

LOADIP。ASP代码

<%

if Session("userip") <> "" then

online=Response.IsClientConnected

online=true

userip=Session("userip")

Response.Write"<table border=1 align=center>"

Response.Write"<tr><td width=100>"

Response.Write("来访者IP:")

Response.Write"<带洞笑/td><td width=200 align=center><a href=#>"

Response.Write(userip)

Response.Write("</a></td><td>")

Response.Write(date())

Response.Write("</td></tr></table>")

else

Response.Write("<div align=center>")

Response.Write("没有来访者")

Response.Write("</div>")

end if

%>

哪里错了,哪位大哥大姐帮帮我!

解析:

没有错误,请问你是那里报错?本地和远程调试都未出现错误啊?

=============

你能解释一下“同时”是个什么意思么?

你的意思是你打开一个页面,如果有访问者登陆后,你打开的那个页面就立即显示出登陆者的IP?

❸ ASP获取ip地址

function getipadd()
ipadd=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if ipadd= "" Then ipadd=Request.ServerVariables("REMOTE_ADDR")
getipadd=ipadd
end function

使用:
response.write getipadd

热点内容
怎样取消屏锁密码是多少 发布:2025-10-17 20:21:23 浏览:275
安卓如何退出ie 发布:2025-10-17 20:21:17 浏览:887
铁路默认账号密码是多少 发布:2025-10-17 20:21:15 浏览:907
集群文件上传 发布:2025-10-17 20:18:52 浏览:594
图像识别java 发布:2025-10-17 19:42:14 浏览:779
phpsha加密 发布:2025-10-17 19:36:15 浏览:242
gpu服务器是什么意思 发布:2025-10-17 19:29:26 浏览:873
java项目源码免费下载 发布:2025-10-17 19:15:57 浏览:497
桌面锁定文件夹 发布:2025-10-17 19:06:21 浏览:539
我的世界网易建造服务器 发布:2025-10-17 18:46:35 浏览:784