一個基於web的QQ程式 1(xml+asp)

來源:互聯網
上載者:User
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=http://edu.cnzz.cn/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>
好了,第一部分就到這裡了!!




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.