private void button1_Click(object sender, EventArgs e) { if (service.Login(textBox1.Text, textBox2.Text, eUserType.Scan, SelfInfo.Ip, SelfInfo.MacAddress, SelfInfo.Hostname)) { Settings.Default.Username = textBox1.Text; Settings.Default.Password = textBox2.Text; Settings.Default.ScanEndpoint = int.Parse(txtScanType.Text); Settings.Default.OddCompare = float.Parse(txtOddCompare.Text); Settings.Default.IbetTimeScan = (int)numIbetLiveTime.Value; Settings.Default.SboTimeScan = (int)numSboLiveTime.Value; Settings.Default.IbetTodayScan = (int)numIbetTodayTime.Value; Settings.Default.SboTodayScan = (int)numSboTodayTime.Value; Settings.Default.IbetProxyAddress = txtProxyIbetAddress.Text; Settings.Default.IpAddress = txtIpAddress.Text; Settings.Default.HasFakeIpSbo = ckFakeIpSbo.Checked; Settings.Default.IpFakeSource = txtIpFakeSource.Text; Settings.Default.Save(); if (!string.IsNullOrEmpty(txtIpAddress.Text)) { var ipList = txtIpAddress.Text.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.None); ScanData.IpAddress = ipList.ToList(); } if (!string.IsNullOrEmpty(txtIpFakeSource.Text)) { var ipList = txtIpFakeSource.Text.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.None); DataContainer.SourceIpFakes = ipList.ToList(); } Process.OddCompare = Settings.Default.OddCompare; ScanData.HasFakeIpSbo = ckFakeIpSbo.Checked; ScanData.ScanEndpointType = Settings.Default.ScanEndpoint; SelfInfo.Username = textBox1.Text; if (string.IsNullOrEmpty(Settings.Default.IbetProxyAddress)) { ScanData.ProxyLoginIbet = false; } else { ScanData.ProxyLoginIbet = true; ScanData.ProxyLoginIbetEndpoint = string.Concat("net.tcp://", Settings.Default.IbetProxyAddress, ":9998/bcwinsupservice"); } SetupScanConfigDTO scanConfig = service.ScanConfig(SelfInfo.Username, ScanData.ScanEndpointType); scanConfig.TimeScanLiveIbet = Settings.Default.IbetTimeScan; scanConfig.TimeScanLiveSbo = Settings.Default.SboTimeScan; ScanAccountDTO scanAccount = service.ScanAccount(SelfInfo.Username); //if (scanAccount.IbetAccounts.Count == 0 || scanAccount.SboAccounts.Count == 0) //{ // var msg = string.Format("Tong tai khoang sbo {0} & ibet {1}", scanAccount.SboAccounts.Count, scanAccount.IbetAccounts.Count); // MessageBox.Show(msg); //} ScanData.ScanAccount = scanAccount; Init(scanConfig); frmMain f = new frmMain(service); f.Show(); this.Hide(); } }