コード例 #1
0
        void ConfigOptionToolStripMenuItemClick(object sender, EventArgs e)
        {
            ConfigOptionForm optionForm = new ConfigOptionForm();

            optionForm.Port = one.Port.ToString();

            if (optionForm.ShowDialog(this) == DialogResult.OK)
            {
                int port = 0;
                if (int.TryParse(optionForm.Port, out port))
                {
                    if (port > 1024)
                    {
                        one.Port = port;
                    }
                    else
                    {
                        MessageBox.Show("Port number is must great than 1204");
                    }
                }
                else
                {
                    MessageBox.Show("Port number is not valid.");
                }
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: seogi1004/plink
        void ConfigOptionToolStripMenuItemClick(object sender, EventArgs e)
        {
            ConfigOptionForm optionForm = new ConfigOptionForm();
            optionForm.Port = one.Port.ToString();

            if (optionForm.ShowDialog(this) == DialogResult.OK) {
                int port = 0;
                if (int.TryParse(optionForm.Port, out port)) {
                    if (port > 1024) {
                        one.Port = port;
                    } else {
                        MessageBox.Show("Port number is must great than 1204");
                    }
                } else {
                    MessageBox.Show("Port number is not valid.");
                }
            }
        }