如何得到浏览者 的 IP 地址、 操作系统、 浏览器 信息

property1 2004-09-07 10:27:36
如题
...全文
262 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
sychallenger 2004-09-18
  • 打赏
  • 举报
回复
to jycjyc(jycjyc)
你是sb
yaozhg 2004-09-08
  • 打赏
  • 举报
回复
倒,搜索一下,一大堆了。
toponly 2004-09-08
  • 打赏
  • 举报
回复
http://www.guochao.com/show.asp?id=224
  • 打赏
  • 举报
回复
http://www.adjyc.com
hxnet 2004-09-08
  • 打赏
  • 举报
回复
谢谢呀
  • 打赏
  • 举报
回复
收藏...
xiaoyuehen 2004-09-08
  • 打赏
  • 举报
回复
以上还有两个自定义函数补上.

Function f__getClientBrowser(s)
'取得浏览器类型
Dim re, aMatch, oMatche ' 建立变量。
Set re = New RegExp ' 建立正则表达式。
Dim i, sTemp
' 设置模式。
re.Pattern = "" & _
"(Netscape" & _
"|Opera" & _
"|NetCaptor" & _
"|MSN " & _
"|MSIE" & _
"|MyIE" & _
"|Mozilla" & _
")" & _
"[\s]{0,1}[0-9]{0,1}\.[0-9]{0,1}"
re.IgnoreCase = True ' 设置不区分大小写。
re.Global = True ' 设置全局可用性

Set aMatch = re.Execute(s)
For Each oMatche in aMatch ' 循环遍历Matches集合。
sTemp = oMatche.Value
If sTemp <> "" Then
f__getClientBrowser = sTemp
Exit Function
End If
Next
f__getClientBrowser = ""
End Function

Function f__getClientSystem(s)
'取得客户端操作系统
Dim re, aMatch, oMatche ' 建立变量。
Set re = New RegExp ' 建立正则表达式。
Dim i, sTemp
' 设置模式。
re.Pattern = "" & _
"(Windows" & _
"|Mac_" & _
"|Mac " & _
"|unix" & _
"|Linux" & _
"|SunOS" & _
"|BSD" & _
")" & _
"[^;\(\)]+"
re.IgnoreCase = True ' 设置不区分大小写。
re.Global = True ' 设置全局可用性

Set aMatch = re.Execute(s)
For Each oMatche in aMatch ' 循环遍历Matches集合。
sTemp = oMatche.Value
If sTemp <> "" Then
f__getClientSystem = sTemp
Exit Function
End If
Next
f__getClientSystem = ""
End Function

若有什么错误, 请用短信通知我,,谢谢.
xiaoyuehen 2004-09-08
  • 打赏
  • 举报
回复
获取客户端IP sClientIp = request.ServerVariables("REMOTE_ADDR")
获取客户端操作系统
sClientStr = Request.ServerVariables("HTTP_USER_AGENT")
sClientSystem = f__getClientSystem(sClientStr)

浏览器
sClientBrowser = f__getClientBrowser(sClientStr)
xiaoyuehen 2004-09-08
  • 打赏
  • 举报
回复
以下代码包括了获取来源页面, 本地页面, 客户分辨率, 颜色位数等信息

//Start count.js

var __xc_sys_url = "http://localhost/_xcounter/";

function _xc_readCookie(name){
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0){
offset = document.cookie.indexOf(search);
if (offset != -1){
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end))
}
}
return cookieValue;
}

function _xc_writeCookie(name, value, hours){
var expire = "";
if(hours != null){
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires=" + expire.toGMTString();
}
document.cookie = name + "=" + escape(value) + expire;
}

var __xc_visited = 1;
var __xc_cookies_name = '__xcouter_' + __xc_uid;
if(_xc_readCookie(__xc_cookies_name).length < 1){
_xc_writeCookie(__xc_cookies_name, 1);
__xc_visited = 0;
}
if (typeof(__xc_style) == "undefined")
{
__xc_style = 18;
}
var __xc_page = location.href;
var __xc_ref = document.referrer;
var __xc_page = escape(location.href);
var __xc_ref = escape(document.referrer);
var __xc_Color = screen.colorDepth;
var __xc_Language = (navigator.systemLanguage ? navigator.systemLanguage : navigator.language);
var __xc_Size = screen.width + '×' + screen.height;
var __xc_count = __xc_sys_url
+ "count/count.asp"
+ "?id=" + __xc_uid
+ "&l=" + __xc_Language
+ "&t=" + __xc_style
+ "&p=" + __xc_page
+ "&r=" + __xc_ref
+ "&s=" + __xc_Size
+ "&c=" + __xc_Color
+ "&v=" + __xc_visited
+ "&z=" + (new Date()).getTimezoneOffset() / 60;
//document.write(__xc_count);
if (typeof(__xc_uid) != "undefined")
{
var __xc_str = '<a href="' + __xc_sys_url + 'stat/index.asp?uid=' + __xc_uid + '" target="_blank">'
+ '<img src="' + __xc_count + '"'
+ ' width="' + __xc_style + '"'
+ ' height="' + __xc_style + '"'
+ ' alt="统计信息" border="0">'
+ '</a>';
document.write(__xc_str);
}

//End count.js
5400 2004-09-07
  • 打赏
  • 举报
回复
有的源码里边就有这样的..

后台里边.你下载下来自己研究下..

28,391

社区成员

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

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