private void Login_CheckBox_Click(object sender, RoutedEventArgs e) { if (this.LoginCheckBox.IsChecked == true) { UserLoginWindow ulw = new UserLoginWindow(); ulw.WindowStartupLocation = WindowStartupLocation.CenterOwner; ulw.Owner = AreaParty.MainWindow.main; ulw.ShowDialog(); string status = util.config.ConfigUtil.GetValue("longconnect"); if (status.Equals("false")) { this.LoginCheckBox.IsChecked = false; } else { this.LoginCheckBox.IsChecked = true; } } else { if (System.Windows.MessageBox.Show("确定断开长连接", "长连接", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes) { util.config.ConfigUtil.SetValue("longconnect", "false"); ClientPCNew2.StopService(); util.config.ConfigUtil.SetValue("longconnect", "false"); MainWindow.main.Status = "长连接断开"; } else { this.LoginCheckBox.IsChecked = true; } } }
public static void CLoseAll() { CloseHttpService(); ClientPCNew2.StopService(); ClosePCinfoService(); CloseUtorrent(); CloseBtReceive(); }