怎么获得对方IP地址?

weiasp 2002-01-29 09:20:00
怎么获得对方IP地址?望知者告之!谢谢!
...全文
418 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
julyclyde 2002-01-29
  • 打赏
  • 举报
回复
绝对可以
weiasp 2002-01-29
  • 打赏
  • 举报
回复
怎么显示不出来!
haiznan 2002-01-29
  • 打赏
  • 举报
回复
request.servervariables("remote_addr")可获对方IP!
request.servervariables("server_name")可获得服务器的IP

ok!!!!!!
blues-star 2002-01-29
  • 打赏
  • 举报
回复
服务器变量,在ASP,PHP,JSP中都好用的
kxcc_sx 2002-01-29
  • 打赏
  • 举报
回复
呵呵!
这个好办
用request.servervariables("remote_addr")
可获得在线人IP!
用request.servervariables("server_name")
可获得服务器的ip
Studio 2002-01-29
  • 打赏
  • 举报
回复
Request("REMOTE_ADDR") 可以得到IP
karma 2002-01-29
  • 打赏
  • 举报
回复
on the server side, use Request.ServerVariables("REMOTE_ADDR")

on the client side, try

arAddresses = GetIPAddresses()
msgbox ubound(arAddresses)+1 & " IP Address(es) found"
for each ip in arAddresses
msgbox ip
next

Function GetIPAddresses()
'=====
' Returns array of IP Addresses as output
' by ipconfig or winipcfg...
'
' Win98/WinNT have ipconfig (Win95 doesn't)
' Win98/Win95 have winipcfg (WinNt doesn't)
'
' Note: The PPP Adapter (Dial Up Adapter) is
' excluded if not connected (IP address will be 0.0.0.0)
' and included if it is connected.
'=====
set sh = createobject("wscript.shell")
set fso = createobject("scripting.filesystemobject")

Set Env = sh.Environment("PROCESS")
if Env("OS") = "Windows_NT" then
workfile = fso.gettempname
sh.run "%comspec% /c ipconfig > " & workfile,0,true
else
'winipcfg in batch mode sends output to
'filename winipcfg.out
workfile = "winipcfg.out"
sh.run "winipcfg /batch" ,0,true
end if
set sh = nothing
set ts = fso.opentextfile(workfile)
data = split(ts.readall,vbcrlf)
ts.close
set ts = nothing
fso.deletefile workfile
set fso = nothing
arIPAddress = array()
index = -1
for n = 0 to ubound(data)
if instr(data(n),"IP Address") then
parts = split(data(n),":")
if trim(parts(1)) <> "0.0.0.0" then
index = index + 1
ReDim Preserve arIPAddress(index)
arIPAddress(index)= trim(cstr(parts(1)))
end if
end if
next
GetIPAddresses = arIPAddress
End Function
luket 2002-01-29
  • 打赏
  • 举报
回复
查查Server对象的属性

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧