HTML5¼¼Êõ

¼±¼±ÈçÂÉÁ»ðËٴһ¸ö¼´Ê±Í¨Ñ¶ÏµÍ³£¡£¨¸½Ô´Âë·ÖÏí¡ª¡ª¸ß¶È¿ÉÒÆÖ²£¡£© - CXLian(3)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£º²©¿ÍÔ° 2016-01-26 18:01 ÎÒÒªÆÀÂÛ( )

1.¿Í»§¶Ë·¢Ë͵ǽÏûÏ¢ private void button_login_Click( object sender, EventArgs e){ this .selfID = this .textBox_ID.Text.Trim();LoginMsg loginMsg = new LoginMsg( this .selfID); this .tcpPassiveEngine.

                                    

1.¿Í»§¶Ë·¢Ë͵ǽÏûÏ¢ 

private void button_login_Click(object sender, EventArgs e) { this.selfID = this.textBox_ID.Text.Trim(); LoginMsg loginMsg = new LoginMsg(this.selfID); this.tcpPassiveEngine.PostMessageToServer(loginMsg.ToContractStream()); }

View Code

2.·þÎñ¶Ë»Ø¸´µÇ½ÏûÏ¢

1 if (msgType == MsgType.Logining) 2 { 3 LoginMsg loginMsg = MsgHelper.DeserializeMsg<LoginMsg>(msg); 4 this.ReplyLogining(loginMsg, userAddress); .TellOtherUser(MsgType.NewOnlineFriend, loginMsg.SrcUserID); 7 } »Ø¸´µÇ½ÏûÏ¢ ReplyLogining(LoginMsg loginMsg, IPEndPoint userAddress) 15 { { 18 loginMsg.LogonResult = LogonResult.Repetition; 19 this.tcpServerEngine.SendMessageToClient(userAddress, loginMsg.ToContractStream()); 20 } { 23 this.AddUser(loginMsg.SrcUserID, userAddress); 24 this.ShowOnlineUserCount(); 25 loginMsg.LogonResult = LogonResult.Succeed; 26 this.tcpServerEngine.SendMessageToClient(userAddress, loginMsg.ToContractStream()); 27 } 28 }

View Code

3.¿Í»§¶Ë´¦ÀíµÇ½½á¹û

tcpPassiveEngine_MessageReceived(IPEndPoint userAddress, byte[] msg) 2 { msgType = BitConverter.ToInt32(msg, 0); (msgType == MsgType.Logining) 7 { 8 LoginMsg loginMsg = MsgHelper.DeserializeMsg<LoginMsg>(msg); 9 if (loginMsg.LogonResult == LogonResult.Succeed) 10 { 11 this.DialogResult = DialogResult.OK; 12 this.tcpPassiveEngine.MessageReceived -= new StriveEngine.CbDelegate<IPEndPoint, byte[]>(tcpPassiveEngine_MessageReceived); 13 } 14 if (loginMsg.LogonResult == LogonResult.Repetition) 15 { ); 17 } 18 } 19 }

View Code                     

Îå·¿Í»§¶Ë»¥ÏàÁÄÌìµÄͨÐŹý³Ì

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • vue2.0°æcnodeÉçÇøÏîÄ¿´î½¨¼°ÊµÕ½¿ª·¢ - sandisen

    vue2.0°æcnodeÉçÇøÏîÄ¿´î½¨¼°ÊµÕ½¿ª·¢ - sandisen

    2017-04-20 14:00

  • net.sz.framework ¿ò¼Ü ÇáËɴ·þÎñ---ÈÃÄã¸üרעÂß¼­¹¦ÄÜ---³õ̽ - ʧ×ã³ÌÐòÔ±

    net.sz.framework ¿ò¼Ü ÇáËɴ·þÎñ---ÈÃÄã¸üרעÂß¼­¹¦ÄÜ---³õ̽ -

    2017-04-02 10:11

  • Ionic2 ¿ª·¢±Ê¼Ç£¨1£©ionic2 +angular2´î½¨ - ÔçÉÏ~µÃ~ºÈÖà

    Ionic2 ¿ª·¢±Ê¼Ç£¨1£©ionic2 +angular2´î½¨ - ÔçÉÏ~µÃ~ºÈÖà

    2017-03-13 16:00

  • React+webpack¿ª·¢»·¾³µÄ´î½¨ - ÓêºÍÑ©

    React+webpack¿ª·¢»·¾³µÄ´î½¨ - ÓêºÍÑ©

    2017-03-11 09:05

ÍøÓѵãÆÀ
¹