コード例 #1
0
ファイル: StartForm.cs プロジェクト: pengpercy/lphant
        private void Accept_OnClick(object sender, System.EventArgs e)
        {
            string IP = IPRemota1.Text + "." + IPRemota2.Text + "." + IPRemota3.Text + "." + IPRemota4.Text;

            if (this.ConectarRemoto.Checked)
            {
                if (CRemoto == null)
                {
                    CRemoto = new CedonkeyCRemoto();
                }

                int puertor;
                if (this.PuertoR.Text == "")
                {
                    puertor = 4670;
                }
                else
                {
                    puertor = System.Convert.ToInt32(this.PuertoR.Text);
                }

                CRemoto.DisConnect();
                if (CRemoto.Connect(IP, pw.Text, puertor))
                {
                    eLePhant.Client.eLePhantForm FormeLePhant = new eLePhantForm(m_elink, m_Mutex, CRemoto.interfazremota);
                    FormeLePhant.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Can not connect or invalid password", "lphant remote connection", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            if (this.IniciarLocal.Checked)
            {
                eLePhant.Client.eLePhantForm FormeLePhant = new eLePhantForm(m_elink, m_Mutex);
                this.Hide();
                FormeLePhant.Show();
            }
        }