我们浏览网页的时候,会不经意间看到,有些地方(如个人的签名档)显示出了个人的IP,操作系统等数据.借助第三方API和请求报头useragent是很容易实现的.

<html>
<head>
<title>Sherry</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://counter.sina.com.cn/ip/" charset="gb2312"></script>
<script>
document.writeln("IP地址:"+ILData[0]+"<br />"); //输出接口数据中的IP地址
document.writeln("地址类型:"+ILData[1]+"<br />"); //输出接口数据中的IP地址的类型
document.writeln("地址类型:"+ILData[2]+"<br />"); //输出接口数据中的IP地址的省市
document.writeln("地址类型:"+ILData[3]+"<br />"); //输出接口数据中的IP地址的
document.writeln("地址类型:"+ILData[4]+"<br />"); //输出接口数据中的IP地址的运营商
//document.write(navigator.userAgent + "<br>");
document.write("您的操作系统版本为:");
if(navigator.userAgent.indexOf("Windows NT 6.2") > 0){
document.write("Windows 8");
}
else if(navigator.userAgent.indexOf("Windows NT 6.1") > 0){
document.write("Windows 7");
}
else if(navigator.userAgent.indexOf("Windows NT 6.0") > 0){
document.write("Windows Vista");
}
else if(navigator.userAgent.indexOf("Windows NT 5.2") > 0){
document.write("Windows 2003");
}
else if(navigator.userAgent.indexOf("Windows NT 5.1") > 0){
document.write("Windows xp");
}
else if(navigator.userAgent.indexOf("Windows NT 5.0") > 0){
document.write("Windows 2000");
}
</script>
</head>
<body> </body>
</html>

显示:

最新文章

  1. 黄聪:wordpress如何获取当前页面的URL
  2. Control character in cookie value, consider BASE64 encoding your value
  3. .\Obj\main.axf: Error: L6406E: No space in execution regions with .ANY selector matching sin_i.o(.co
  4. Grnymotion模拟器和Android真机访问PC端Tomcat下的应用
  5. SPFA和FLOYD算法如何打印路径
  6. asp.net权限认证:OWIN实现OAuth 2.0 之授权码模式(Authorization Code)
  7. 使用websocket-sharp来创建c#版本的websocket服务
  8. Google的SPDY协议成为HTTP 2.0的基础
  9. git fatal: I don&#39;t handle protocol &#39;https&#39;问题的解决
  10. Spring Boot中使用MyBatis注解配置详解(1)
  11. 实战经验|大神战队都在i春秋教你打CTF
  12. layui数据表格监听按钮问题
  13. Nginx 优化缓冲区与传输效率
  14. Docker下的Spring Cloud三部曲之一:极速体验
  15. Newtonsoft.Json高级用法,json序列号,model反序列化,支持序列化和反序列化DataTable,DataSet,Entity Framework和Entity,字符串
  16. SVN、Git设置提交时忽略的文件
  17. hadoop1.x异常
  18. linux命令系列 stat &amp; touch
  19. LINUX内核中的机制OOM
  20. bzoj3401

热门文章

  1. .net 异步编程总结
  2. OSS上传图片无法在线预览的解决方案
  3. 动态规划之抢劫问题-LT213
  4. Django之models高级进阶技术详解
  5. 005.kubernets之pods的资源限制和健康检查
  6. OpenLayers 笔记
  7. 怎么将文件夹上传到GitHub上
  8. unittest模块使用方法
  9. 假期续命充电——简单上手tesorflow2 框架
  10. 洛谷 P5424 [USACO19OPEN]Snakes