快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

一个基于WEB的QQ程序 1(XML+ASP)

refresh.htm
=========
<HTML>
<HEAD>
<title>在线QQ</title>
<link rel="stylesheet" type="text/css" href="forum.css">
</HEAD>
<BODY onload=online() scroll=no topmargin="0" leftmargin="0" style="background-color: #8482C6; color:
#FFFFFF; border: 2 solid #FFFFFF; padding: 0">
<marquee><font color=black>假如关闭此窗口将失去在线QQ功能!</font></marquee>
<!--嘿嘿!!这里引用了ZEE的转变代码,用于解决无法显示汉字的,本来还有一段的不过在俺用的时候,发现加上那一段就不行了,所以去掉了,有爱好的朋友可以到精华区去找一下zee的文章 -->
<script language="vbscript">
Function bytes2BSTR(vIn)
strReturn=""
For i=1 To LenB(vIn)
ThisCharCode=AscB(MidB(vIn,i,1))
If ThisCharCode<&H80 Then
strReturn=strReturn&Chr(ThisCharCode)
Else
NextCharCode=AscB(MidB(vIn,i+1,1))
strReturn=strReturn&Chr(CLng(ThisCharCode)*&H100+CInt(NextCharCode))
i=i+1
End If
Next
bytes2BSTR=strReturn
End Function
</script>
<!--汉字转变函数结束 -->
<script language="javascript">
var lengt=0;
<!--消除右键功能-->
function no(){
alert("不支持右键!");
self.event.returnValue=false;
}
<!--弹出QQ对话框,见后面-->
function sqq(uid,id){
window.open("sqq.asp?id="+id+"&uid="+uid,"_blank","width=400,height=180");
}
<!--要害的函数,用于显示在线的会员-->
function online(){
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("post","online.asp",false);
xmlhttp.send();
var xmldom=new ActiveXObject("Microsoft.XMLDOM");
xmldom.async=false;
body=bytes2BSTR(xmlhttp.responseBody);
xmldom.loadXML(body);
if(xmldom.parseError.errorCode!=0){
window.open("refresh2.asp","_self");<!--为了防止有些用户不支持xml,所以用了一个备用的asp版的-->
return
}
else{
var uid=xmldom.documentElement.selectNodes("uid");
var id=xmldom.documentElement.selectNodes("id");
var sex=xmldom.documentElement.selectNodes("sex");
var xx="";
lengt=uid.length;
for(var i=0;i<lengt;i++){
var im="";
if(id(0).text!="k") im="<img src=../jy/face/1.gif width=12 height=12>";
xx=xx+im+"<font color=red onclick=sqq(\\\'"+uid(i).text+"\\\',\\\'"+id(i).text+"\\\') style=\\\'cursor:hand\\\'
title=\\\'"+sex(i).text+"\\\'>"+uid(i).text+"</font><br>";
}
disonline.innerHTML=xx;
window.setTimeout("online()",3000);
}
}

</script>
<!--这个"resfresh4.asp"是用于当有自己的信息时弹出QQ对话框用的-->
<iframe src="refresh4.asp" width=0 height=2 marginwidth=0 marginheight=0 frameborder=0>
</iframe>

<input type=button value=" 在线网友:" class=ddyinput2>
<div id=disonline style="height:230;overflow: auto"></div><br>
<!--这里用到了scriptlet技术,你也可以试一下,和include差不多-->
<OBJECT data=i11.htm height=14 style="HEIGHT: 93px; WIDTH: 770px"
type=text/x-scriptlet width=14 VIEWASTEXT></OBJECT>


</BODY>
</HTML>
好了,第一部分就到这里了!!
返回类别: 教程
上一教程: ASP实现对新闻的分页例子
下一教程: 统计在线人数、每日访问人数和总人数

您可以阅读与"一个基于WEB的QQ程序 1(XML+ASP)"相关的教程:
· 一个基于WEB的QQ程序 2(XML+ASP)
· 一个基于web的QQ程序 2(xml+asp)
· 发送信息页面SEND.ASP--基于WEB的QQ程序3
· 显示页面SHOW.ASP--基于WEB的QQ程序1
· 显示页面show.asp--基于web的QQ程序1 
    微笑服务 优质保证 索取样品