示例#1
0
 private void ShowSetConnBtn_Click(object sender, EventArgs e)
 {
     SetConn sc = new SetConn();
     sc.ShowDialog();
     if (ConnInfo.Dbstruct == "3.0.X")
     {
         dmg_min3TextBox.Enabled = true;
         dmg_max3TextBox.Enabled = true;
         dmg_type3List.Enabled = true;
         dmg_min4TextBox.Enabled = true;
         dmg_max4TextBox.Enabled = true;
         dmg_type4List.Enabled = true;
         dmg_min5TextBox.Enabled = true;
         dmg_max5TextBox.Enabled = true;
         dmg_type5List.Enabled = true;
         FactionTextBox.Enabled = false;
         HolidayIDTextBox.Enabled = false;
         label1.Text = "Faction(阵营):";
     }
     else if (ConnInfo.Dbstruct == "3.1.X")
     {
         dmg_min3TextBox.Enabled = false;
         dmg_max3TextBox.Enabled = false;
         dmg_type3List.Enabled = false;
         dmg_min4TextBox.Enabled = false;
         dmg_max4TextBox.Enabled = false;
         dmg_type4List.Enabled = false;
         dmg_min5TextBox.Enabled = false;
         dmg_max5TextBox.Enabled = false;
         dmg_type5List.Enabled = false;
         FactionTextBox.Enabled = false;
         HolidayIDTextBox.Enabled = false;
         label1.Text = "Faction(阵营):";
     }
     else if (ConnInfo.Dbstruct == "3.2.X")
     {
         dmg_min3TextBox.Enabled = false;
         dmg_max3TextBox.Enabled = false;
         dmg_type3List.Enabled = false;
         dmg_min4TextBox.Enabled = false;
         dmg_max4TextBox.Enabled = false;
         dmg_type4List.Enabled = false;
         dmg_min5TextBox.Enabled = false;
         dmg_max5TextBox.Enabled = false;
         dmg_type5List.Enabled = false;
         FactionTextBox.Enabled = true;
         HolidayIDTextBox.Enabled = false;
         label1.Text = "Faction(阵营):";
     }
     else if (ConnInfo.Dbstruct == "3.3.X")
     {
         dmg_min3TextBox.Enabled = false;
         dmg_max3TextBox.Enabled = false;
         dmg_type3List.Enabled = false;
         dmg_min4TextBox.Enabled = false;
         dmg_max4TextBox.Enabled = false;
         dmg_type4List.Enabled = false;
         dmg_min5TextBox.Enabled = false;
         dmg_max5TextBox.Enabled = false;
         dmg_type5List.Enabled = false;
         FactionTextBox.Enabled = true;
         HolidayIDTextBox.Enabled = true;
         label1.Text = "Faction(阵营):";
     }
     else if (ConnInfo.Dbstruct == "真爱XV")
     {
         HolidayIDTextBox.Text = ItemInfo.HolidayId;
         label1.Text = "FlagsExtra:";
     }
     if (ConnInfo.Stat)
     {
         ConnStat.Text = ConnInfo.UserName + "@" + ConnInfo.HostName;
         if (ConnInfo.DataBase != "")
         {
             ConnStat.Text += " → " + ConnInfo.DataBase;
         }
         ConnStat.Text += "(" + ConnInfo.Dbstruct + ")";
     }
     else
     {
         ConnStat.Text = "未连接";
     }
 }
示例#2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     ConnInfo.HostName = "LocalHost";
     ConnInfo.SaveConnInfo = false;
     ConnInfo.SavePwd = false;
     bool ContinueLoad = false;
     do
     {
         try
         {
             this.LoadConnInfoXml();
         }
         catch (Exception err)
         {
             DialogResult re = MessageBox.Show("由于以下原因连接信息没有成功读取:" + err.Message, "连接信息", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
             if (re == DialogResult.Retry)
                 ContinueLoad = true;
             else if (re == DialogResult.Cancel)
                 ContinueLoad = false;
         }
     } while (ContinueLoad);
     GetList();
     SetConn sc = new SetConn();
     sc.ShowDialog();
     if (ConnInfo.Dbstruct == "3.0.X")
     {
         dmg_min3TextBox.Enabled = true;
         dmg_max3TextBox.Enabled = true;
         dmg_type3List.Enabled = true;
         dmg_min4TextBox.Enabled = true;
         dmg_max4TextBox.Enabled = true;
         dmg_type4List.Enabled = true;
         dmg_min5TextBox.Enabled = true;
         dmg_max5TextBox.Enabled = true;
         dmg_type5List.Enabled = true;
         FactionTextBox.Enabled = false;
         HolidayIDTextBox.Enabled = false;
     }
     else if (ConnInfo.Dbstruct == "3.1.X")
     {
         dmg_min3TextBox.Enabled = false;
         dmg_max3TextBox.Enabled = false;
         dmg_type3List.Enabled = false;
         dmg_min4TextBox.Enabled = false;
         dmg_max4TextBox.Enabled = false;
         dmg_type4List.Enabled = false;
         dmg_min5TextBox.Enabled = false;
         dmg_max5TextBox.Enabled = false;
         dmg_type5List.Enabled = false;
         FactionTextBox.Enabled = false;
         HolidayIDTextBox.Enabled = false;
     }
     else if (ConnInfo.Dbstruct == "3.2.X")
     {
         dmg_min3TextBox.Enabled = false;
         dmg_max3TextBox.Enabled = false;
         dmg_type3List.Enabled = false;
         dmg_min4TextBox.Enabled = false;
         dmg_max4TextBox.Enabled = false;
         dmg_type4List.Enabled = false;
         dmg_min5TextBox.Enabled = false;
         dmg_max5TextBox.Enabled = false;
         dmg_type5List.Enabled = false;
         FactionTextBox.Enabled = true;
         HolidayIDTextBox.Enabled = false;
     }
     else if (ConnInfo.Dbstruct == "3.3.X")
     {
         dmg_min3TextBox.Enabled = false;
         dmg_max3TextBox.Enabled = false;
         dmg_type3List.Enabled = false;
         dmg_min4TextBox.Enabled = false;
         dmg_max4TextBox.Enabled = false;
         dmg_type4List.Enabled = false;
         dmg_min5TextBox.Enabled = false;
         dmg_max5TextBox.Enabled = false;
         dmg_type5List.Enabled = false;
         FactionTextBox.Enabled = true;
         HolidayIDTextBox.Enabled = true;
     }
     if (ConnInfo.Stat)
     {
         ConnStat.Text = ConnInfo.UserName + "@" + ConnInfo.HostName;
         if (ConnInfo.DataBase != "")
         {
             ConnStat.Text += " → " + ConnInfo.DataBase;
         }
         ConnStat.Text += "(" + ConnInfo.Dbstruct + ")";
     }
     else
     {
         ConnStat.Text = "未连接";
     }
 }