Ejemplo n.º 1
0
        private void ConfirmIP_Click(object sender, EventArgs e)
        {
            this.IPmaskedTextBox.ValidatingType = typeof(IPAddress);
            char[]   delimit   = { ' ' };
            string[] str       = IPmaskedTextBox.Text.Split();
            string   separator = "";

            adress = string.Join(separator, str);
            bool b = IPAddress.TryParse(adress, out ServerIP);

            if (b)
            {
                ServerBools.ResetBools();
                ipConfirmLabel.ForeColor = Color.Lime;
                ipConfirmLabel.Text      = "IP is Valid";
                serData.IPofServer       = adress;
                //IPisChanged(this, serData);
                //Close();
            }

            else
            {
                ipConfirmLabel.ForeColor = Color.Red;
                ipConfirmLabel.Text      = "IP is Invalid, please try again";
            }
        }
Ejemplo n.º 2
0
        private void PortConfirmationButtom_Click(object sender, EventArgs e)
        {
            int portnum = int.Parse(portTextBox.Text);

            if (portnum.PortisValid())
            {
                ServerBools.ResetBools();
                Sdata.PortofServer         = portnum;
                portConfirmLabel.ForeColor = Color.Lime;
                portConfirmLabel.Text      = "Port is Valid";
                ////PortisChanged(this, Sdata);
                //Close();
            }

            else
            {
                portConfirmLabel.ForeColor = Color.Red;
                portConfirmLabel.Text      = "Port Number is Illigal \n Pelease choose port from 10000 to 65535";
            }
        }