private void nhandulieu(object o) { String str = ""; while (true) { str = tcp.ReadData(); HandleReceive(str); // tcp.SendData("OK"); } }
void ReceiveData() { while (true) { string data = tcp.ReadData(); textBox5.Text = data; NhanBai(data); pictureBox1.Image = DrawCard(cards[0]); pictureBox1.Visible = true; pictureBox2.Image = DrawCard(cards[1]); pictureBox2.Visible = true; pictureBox3.Image = DrawCard(cards[2]); pictureBox3.Visible = true; pictureBox4.Image = DrawCard(cards[3]); pictureBox4.Visible = true; pictureBox5.Image = DrawCard(cards[4]); pictureBox5.Visible = true; pictureBox6.Image = DrawCard(cards[5]); pictureBox6.Visible = true; pictureBox7.Image = DrawCard(cards[6]); pictureBox7.Visible = true; pictureBox8.Image = DrawCard(cards[7]); pictureBox8.Visible = true; pictureBox9.Image = DrawCard(cards[8]); pictureBox9.Visible = true; pictureBox10.Image = DrawCard(cards[9]); pictureBox10.Visible = true; pictureBox11.Image = DrawCard(cards[10]); pictureBox11.Visible = true; pictureBox12.Image = DrawCard(cards[11]); pictureBox12.Visible = true; pictureBox13.Image = DrawCard(cards[12]); pictureBox13.Visible = true; } }