private void button1_Click(object sender, EventArgs e) { ClientStatus.client = new TcpClient(); ClientStatus.serverip = IPAddress.Parse(textBox1.Text);; try { ClientStatus.client.Connect(ClientStatus.serverip, 50000); } catch (Exception ee) { MessageBox.Show("Server not found\r\n" + "Check the server IP again!"); return; } Form_Roomba form_Roomba; ClientStatus.Connect(); form_Roomba = new Form_Roomba(this); form_Roomba.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { ClientStatus.client = new TcpClient(); ClientStatus.serverip = IPAddress.Parse(textBox1.Text);; try { ClientStatus.client.Connect(ClientStatus.serverip, 50000); } catch (Exception ee) { MessageBox.Show("Server not found\r\n" + "Check the server IP again!"); return; } Form_BOCU form_BOCU; try { ClientStatus.Connect(); form_BOCU = new Form_BOCU(this); form_BOCU.Show(); this.Hide(); } catch (Exception ee) { MessageBox.Show("Another <" + ClientStatus.type + " > is already connected to the server."); return; } }