欢迎光临
我们一直在努力

用asp实现QQ在线查询-ASP教程,ASP应用

建站超值云服务器,限时71元/月

编者(icech)按:这段程序的方法是利用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="http://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("\"(http://img.tencent.com/face/[^\"]+)\"","ig");

if (re.test(webstr))

return "<a href=\"http://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>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 用asp实现QQ在线查询-ASP教程,ASP应用
分享到: 更多 (0)

相关推荐

  • 暂无文章