private void newtab(TLoginInfo LoginInfo) { // check if repeat login for (int i = 1; i < tabControl1.TabCount; i++) { if (!(tabControl1.TabPages[i].Controls[0] is MainFrame)) { continue; } MainFrame mf = tabControl1.TabPages[i].Controls[0] as MainFrame; if (mf.LoginInfo.Username == LoginInfo.Username && mf.LoginInfo.Server == LoginInfo.Server) { textLog.AppendText(string.Format("[{0}][{1}] {2}{3}", DateTime.Now.ToString(), "Info", mui._("repeatlogin") + LoginInfo.Username + " @ " + LoginInfo.Server, Environment.NewLine)); return; } } TabPage tp = new TabPage(); MainFrame uc1 = new MainFrame() { LoginInfo = LoginInfo, mui = mui }; uc1.UpTP = tp; uc1.Dock = DockStyle.Fill; tp.Controls.Add(uc1); tabControl1.TabPages.Add(tp); tabControl1.SelectTab(tp); uc1.Login(); timer1.Enabled = true; }
private void button1_Click(object sender, EventArgs e) { if(textBox3.Text != "" && textBox2.Text != "" && (_ismodify || textBox1.Text != "")) { accountresult = new TLoginInfo() { Server = textBox3.Text, Username = textBox2.Text, Password = textBox1.Text, Tribe = comboBox1.SelectedIndex, Language = textBox4.Text, GetOrPostTimesThreshold = Convert.ToInt32(numericUpDown1.Value), GetOrPostDelaySeconds = Convert.ToInt32(numericUpDown2.Value) }; } }
private void button1_Click(object sender, EventArgs e) { if (textBox3.Text != "" && textBox2.Text != "" && (_ismodify || textBox1.Text != "")) { accountresult = new TLoginInfo() { Server = textBox3.Text, Username = textBox2.Text, Password = textBox1.Text, Tribe = comboBox1.SelectedIndex, Language = textBox4.Text, GetOrPostTimesThreshold = Convert.ToInt32(numericUpDown1.Value), GetOrPostDelaySeconds = Convert.ToInt32(numericUpDown2.Value) }; } }
private void newtab(TLoginInfo LoginInfo) { // check if repeat login for(int i = 1; i < tabControl1.TabCount; i++) { if(!(tabControl1.TabPages[i].Controls[0] is MainFrame)) continue; MainFrame mf = tabControl1.TabPages[i].Controls[0] as MainFrame; if(mf.LoginInfo.Username == LoginInfo.Username && mf.LoginInfo.Server == LoginInfo.Server) { textLog.AppendText(string.Format("[{0}][{1}] {2}{3}", DateTime.Now.ToString(), "Info", mui._("repeatlogin") + LoginInfo.Username + " @ " + LoginInfo.Server, Environment.NewLine)); return; } } TabPage tp = new TabPage(); MainFrame uc1 = new MainFrame() { LoginInfo = LoginInfo, mui = mui }; uc1.UpTP = tp; uc1.Dock = DockStyle.Fill; tp.Controls.Add(uc1); tabControl1.TabPages.Add(tp); tabControl1.SelectTab(tp); uc1.Login(); timer1.Enabled = true; }
private void Btn_OK_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtProxy.Text)) { var m = Regex.Match(txtProxy.Text, @"^((1?\d?\d|(2([0-4]\d|5[0-5])))\.){3}(1?\d?\d|(2([0-4]\d|5[0-5]))):\d{1,5}$"); if (!m.Success) { MessageBox.Show("�����ַ��ʽ����"); txtProxy.Text = string.Empty; } } if (txtServer.Text != "" && txtID.Text != "" && (_ismodify || txtPWD.Text != "")) { accountresult = new TLoginInfo() { Server = txtServer.Text.ToLower(), Username = txtID.Text, Password = txtPWD.Text, Tribe = comboBox1.SelectedIndex, Language = txtLanguage.Text.ToLower(), Proxy = txtProxy.Text, ServerLang = txtServerLang.Text }; } }