Example #1
0
 private void btn_Send_Click(object sender, EventArgs e)
 {
     try
     {                                       //通过TCP协议向服务器发送群发消息
         string temp = this.tb_SendMsg.Text; //保存TextBox文本
         Bw.Write("barchmsg#" + Username + "#" + temp);
         Bw.Flush();
         AddMessage("barchmsg#" + Username + '#' + temp, false);
         this.tb_SendMsg.Clear();
     }
     catch
     { }
 }
Example #2
0
        //修改属性

        /*private void mustate(string GID,string groupname,string sign)
         * {
         *  foreach (ListViewItem item in this.lv_group.Items)
         *  {
         *      if (item.Text == GID)
         *      {
         *          item.SubItems[1].Text = groupname;
         *          item.SubItems[4].Text = sign;
         *      }
         *  }
         * }
         * private void state(string UID,string username,string sign)
         * {
         *
         * }*/
        //关闭窗口
        private void list_FormClosed(object sender, FormClosedEventArgs e)
        {
            try
            {
                string sendmsg = "logout#" + UID;
                Bw.Write(sendmsg);
                Bw.Flush();
                iswork = false;
                Br.Close();
                Bw.Close();
            }
            catch
            { }
            Application.Exit();
        }