⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 system.htm

📁 Csharp版聊天室,初步了解.NET 网络编程
💻 HTM
📖 第 1 页 / 共 3 页
字号:
		
		function reload_mlist()
		{ 
		    parent.member1.listcount.innerHTML="?";
		    parent.member1.listuser.innerHTML="用户统计中......";
		    parent.h3.location.href="getmember.aspx";
		    showmemberlist();
		}
		
		function showmemberlist()
		{
		    var userlist=parent.nstormchat_memeber;
		    var usercount=userlist.length;
		    var v="";
		    var name;
		    for(var i=0;i<usercount;i++)
		    {
		         name=userlist[i].split("|");
		         if(userlist[i].indexOf(myid)!=-1)
		         {
		            v+="<div width=\"100%\" onMousedown=\"this.style.border=\'2 outset #009900\';this.style.backgroundColor=\'#66cc99\';\" onMouseOver=\"this.style.border=\'1 outset #006600\';this.style.backgroundColor=\'#BAFEE8\';\" onmouseout=\"this.style.border=\'0\';this.style.backgroundColor=\'\';\" title=\":)&#13;&#10;单击更改个人信息!&#13;&#10;----------------------&#13;&#10;性别:"+name[3]+"\"><img src=\"images/head/"+name[1]+"\" width=\"18\" height=\"18\">";
		            v+="<a href=\"#\" onclick=\"javascript:parent.h0.changemyms();\"><font color=\"#ff0000\">"+name[2]+"</font></a></div>";	
		         }
		         else
		         {
		            v+="<div width=\"100%\" onMousedown=\"this.style.border=\'2 outset #009900\';this.style.backgroundColor=\'#66cc99\';\" onMouseOver=\"this.style.border=\'1 outset #006600\';this.style.backgroundColor=\'#BAFEE8\';\" onmouseout=\"this.style.border=\'0\';this.style.backgroundColor=\'\';\" title=\":)&#13;&#10;很高兴遇见你!&#13;&#10;---------------------&#13;&#10;性别:"+name[3]+"\"><img src=\"images/head/"+name[1]+"\" width=\"18\" height=\"18\" >";
		            v+="<a href=\"#\" onclick=\"javascript:parent.h0.addtobody('"+name[0]+"');return false;\">"+name[2]+"</a></div>";	
		         }
		    } 
		    parent.member1.listcount.innerHTML=usercount;
		    parent.member1.listuser.innerHTML=v;
            return false;
		}
		
		function changemyms()
		{
		    window.open("changewindow.htm",'chgwindow0','menubar=0,toolbar=0,location=no,status=no,directories=0,scrollbars=0,width=280,height=200');
		}
		
		function showhelp()
		{
		    window.showModelessDialog("help.htm", window, "dialogHeight: 280px; dialogWidth: 480px; center: Yes; help: No; resizable: No; scroll: No; status: No;");
		}
		
		function checkbadword(v)
        {
            for (var i = 0; i < badword.length; i ++)
            {
                if (v.indexOf(badword[i]) != -1)
                {
                    return true;
                }
            }
            return false;
        }
 
		function sendword()
		{
		   var v0=parent.nstormchat_userface;//myface
		   var v1=parent.send.word0.value;//myname
		   var v2=parent.nstormchat_toface;//toface
		   var v3=parent.send.word1.value;//toname
		   var v4=parent.send.word2.value;//mypress
		   var v5=parent.send.word3.value;//mycolor
		   var v11=myid;//userid use in send
		   var v31=parent.nstormchat_toid;//touserid use in snend
		   var v6;
		   if(parent.send.word4.checked == true && v3!="大家") 
		   {
		      v6="toonly";
		   }
		   else
		   {
		      v6="toall";
		   }
		   //onlyto
		   var v7=parent.send.word7.value;//mywords
		   //v7=v7.replace(/  /g,"");
		   if(v7.length<1 || myid=="" )
		   {
		       parent.send.word7.focus();
		       return;
		   }
		   while(v7.lastIndexOf("  ")>0)
		   {
		       v7=v7.replace(/  /g," ");
		   }
		   if(v7.length<1|| v7.replace(/ /g,"")=="")
		   {
		       parent.send.word7.value="";
			   parent.send.word7.focus();
		       return;
		   }
		   v7=v7.replace(/</g,"&lt;");
		   v7=v7.replace(/>/g,"&gt;");
		   if (checkbadword(v7))
           {
               alert("请不要说脏话!");
               parent.send.word7.focus();
               return false;
           }
           if (v31 == oldname && v7 == oldword)
           {
               alert("请不要对同一个人输入重复的发言!");
               parent.send.word7.focus();
               return false;
           }
           if(v7.indexOf("%%")>0 && v3=="大家")
           {
               alert("此动作是对某一个人实施。\r请选择一个对象!");
               parent.send.word7.focus();
               return false;
           }
		   var today=new Date();
		   var v8=today.getHours()+":"+today.getMinutes()+":"+today.getSeconds();
		   parent.send.word7.value="";
		   oldname=v31;
		   oldword=v7;
		   nstormchat_timeout=1200;
		   print_ms(v6,v0,v11,v2,v31,v4,v5,v7,v8);
		   setsubmit(v0,v11,v2,v31,v4,v5,v6,v7);
		   addthis(v7);
		   document.postwords.submit();
		   parent.send.word7.focus();
		}
		
function timeline()
{
parent.send.word12.value = nstormchat_timeout;
if (nstormchat_timeout <=0)
{
     parent.h3.location.href = "exit.aspx";
     parent.h2.location.href="about:blank";
     allms="<img src=\"images/sys.gif\"><font color=\"#ff0000\">你已经离开了聊天室,你可以重新登陆!</font>";
     parent.show1.scroll(0, 64000);
     parent.show1.document.writeln("<div width=\"100%\" class=\"gb12\" height=\"16\">"+allms+"</div>");
     parent.nstormchat_userid="";
     myid="";
     parent.nstormchat_username="";
     parent.nstormchat_userface="";
}
else
{
if (nstormchat_timeout == 180)
{
    alert("三分钟内还不发言你将自动退出!");
}
setTimeout("timeline()",1000);
}
nstormchat_timeout --;
}
		
var whamsg = new Array(10);
var base = 0;
var zp = 0;
var j;
for (j = 0; j <10; j ++)
{
	whamsg[j] = "";
}
		
function wordback()
{
	if (zp > 0)
	{
		zp --;
		parent.send.word7.value = whamsg[zp];
		parent.send.word7.focus();
	}
}

function wordgo()
{
	if (zp < base)
	{
		zp ++;
		parent.send.word7.value = whamsg[zp];
		parent.send.word7.focus();
	}
}

function addthis(v)
{
	if (base < 10)
	{
		whamsg[base] = v;
		base ++;
	}
	else
	{
		for (i = 0; i < 9; i ++)
		{
			whamsg[i] = whamsg[i+1];
		}
		whamsg[i] = v;
	}
	zp = base;
}
		
		function getname(id)
		{
		     if (id=="大家") 
		         return String("大家");
		     var name;
		     if (id==myid)
		         return String(parent.nstormchat_username); 
		     var mlist=parent.nstormchat_memeber;
		     var mcount=mlist.length;
		     for(var i=0;i<mcount;i++)
		     {
		          if(mlist[i].indexOf(id)!=-1)
		          {
		              name=mlist[i].split("|"); 
		              return String(name[2]); 
		          }
		      }  
		     return String(id+"(已离开)");
		}
		
		function getface(id)
		{
		     if (id=="大家") 
		         return String("head1.gif");
		     var name; 
		     var mlist=parent.nstormchat_memeber;
		     var mcount=mlist.length;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -