用asp实现QQ在线查询
添加时间: 2006-5-4 3:42:41 作者: ASP教程 阅读次数:85 来源: http://d9soft.com
<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>
上一篇文章: 创建一个ASP通用分页类(一) 下一篇文章: 常用Email组件发送函数
相关文章:
相关软件:

