示例#1
0
 private void button1_Click(object sender, EventArgs e)
 {
     Properties.Settings.Default.Host = host.Text;
     Properties.Settings.Default.User = user.Text;
     Properties.Settings.Default.Pass = pass.Text;
     Properties.Settings.Default.CharDB = chardb.Text;
     Properties.Settings.Default.WorldDB = worlddb.Text;
     Properties.Settings.Default.Port = port.Text;
     Properties.Settings.Default.AuthDB = txtAuth.Text;
     while (true)
     {
         try
         {
             con = new Connection();
             con.charconn.Close();
             con.worldconn.Close();
             //con.authconn.Close();
             con.charconn.Open();
             con.worldconn.Open();
             con.authconn.Open();
             DialogResult = System.Windows.Forms.DialogResult.OK;
             this.Close();
             break;
         }
         catch (Exception ex)
         {
                 DialogResult dr;
                 dr = MessageBox.Show(this, "Something went wrong. Exception message:\n" + ex.Message, "Error!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                 if (dr == System.Windows.Forms.DialogResult.Cancel) break;
         }
     }
 }
示例#2
0
 private void ReOpenConnections()
 {
     con = new Connection();
 }
示例#3
0
        private void Form1_Activated(object sender, EventArgs e)
        {
            try
            {

                if (con.charconn.State != ConnectionState.Open) con.charconn.Open();
                if (con.worldconn.State != ConnectionState.Open) con.worldconn.Open();
                //if (con.authconn.State != ConnectionState.Open) con.authconn.Open();
            }
            catch
            {
                btnSett_Click(btnSett, EventArgs.Empty);
                con = new Connection();
            }
            if (selnames.Count > 0) btnRec.Text = selnames.Count.ToString() + " receivers";
        }