예제 #1
0
 private void ConnectButton_Click(object sender, EventArgs e)
 {
     if (RegexTests.checkIP(Adress.Text) && RegexTests.isPortNumber(PortBox.Text))
     {
         DialogResult = DialogResult.OK;
         this.Close();
     }
     else
     {
         MessageBox.Show("Niepoprawny adres IP lub/i numer portu", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #2
0
 private void Adress_TextChanged(object sender, EventArgs e)
 {
     Adress.BackColor = (RegexTests.checkIP(Adress.Text)) ? Color.LightGreen : Color.Red;
 }