当前位置: 移动技术网 > IT编程>开发语言>.net > 精彩:用Asp实现QQ在线查询

精彩:用Asp实现QQ在线查询

2018年10月19日  | 移动技术网IT编程  | 我要评论

疯狂企鹅大滑梯,冒犯家族演员白天,3265小游

这段程序的方法是利用xmlhttp来读取腾讯网站的相应html代码获取qq的头像,根据这个想法,我们还可以抓取很多其他网站的信息,如天气预报、新闻等等。


  <script language="javascript">
  <!--
  function getfaceimg(qqcode)
  {
  var re=new regexp("^[1-9]{1}\d+$","g");
  if (!qqcode||!re.test(qqcode)) return;
  var url="https://search.tencent.com/cgi-bin/friend/oicq_find?oicq_no="+qqcode;
  var http=new activexobject("microsoft.xmlhttp");
  http.open("get",url,false,"","");
  http.setrequestheader("content-type","text/html; charset=gb2312");
  http.send();
  
  if (http.status!=200) return;
  
  var webstr=http.responsetext;
  re=new regexp(""(https://img.tencent.com/face/[^"]+)"","ig");
  if (re.test(webstr))
  return "<a href="https://search.tencent.com/cgi-bin/friend/user_show_info?ln="+qqcode+"" target=_blank title="qq:"+qqcode+""><img src=""+regexp.$1+"" width=16 height=16 border=0></a>";

  http=null;
  }

  document.write("我的qq状态:"+getfaceimg("44723461"));
  //-->
  </script>

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网