Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         IPAddress ip = IPAddress.Parse(IPTextBox.Text);
         server = new Server(IPTextBox.Text, int.Parse(portTextBox.Text));
         logic = new Logic(int.Parse(portTextBox.Text), IPTextBox.Text, uniqueNameTextBox.Text);
         connectButton.Enabled = false;
         printLog("connected ip: " + IPTextBox.Text);
     }
     catch (FormatException)
     {
         printLog("Wrong data format: ");
     }
 }
Пример #2
0
 private void disconnectButton_Click(object sender, EventArgs e)
 {
     if (null != server && null != logic)
     {
         logic.sendDead();
         logic.dispose();
         logic = null;
         server.Dispose();
         server = null;
         printIPlist(iplist);
         connectButton.Enabled = true;
         nodeListextBox.Text = "";
     }
 }