/// <summary> /// 点击登录按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { IThirtfService its = new ThirftService(); try { if (its.Login(IP.Text.ToString().Trim(), int.Parse(Port.Text.Trim()))) { if (isAutoLOgin == "0") { autoLogin.Stop(); } RemberIPAndPort(); ClientType = ConfigurationManager.AppSettings["功能选择"]; ClientArea = Convert.ToInt32(ConfigurationManager.AppSettings["所属区域"]); BasicInfo.SetBasicInfo(); foreach (var config in BasicInfo.ConfigList) { if (config.AreaType == ClientArea) { ClientAreaName = config.AreaName; } } MainWindow _mainWindow = new MainWindow(); this.Hide(); _mainWindow.Show(); } else { if (isAutoLOgin != "0") { MessageBox.Show("失败"); } } } catch (Exception ex) { MessageBox.Show("登录失败"); _WriteLog.WriteToLog("登录失败", ex.Message); } }