示例#1
0
文件: Form1.cs 项目: mrs2mrs/RA-mutex
 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
文件: Form1.cs 项目: mrs2mrs/RA-mutex
 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 = "";
     }
 }