private void btnKill_Click(object sender, RoutedEventArgs e) { btnKill.IsEnabled = true; string exename = (string)lstbxProcesses.SelectedValue; service.CloseCustomProcess(parent.getParent().getSelectedClients(), exename); procList.Remove(exename); lstbxProcesses.ItemsSource = null; lstbxProcesses.ItemsSource = procList; parent.ProcessStopped(exename); }
private void btnKill_Click(object sender, RoutedEventArgs e) { btnKill.IsEnabled = true; var exename = (string)lstbxProcesses.SelectedValue; var threadId = ""; string test1 = exename; foreach (var client in parent.getParent().getSelectedClients()) { foreach (var temp in service.CompAndProcesseses) { if (temp.computer == client && temp.processName == exename) { threadId = temp.threadID; } } } service.KillRemoteProcess(parent.getParent().getSelectedClients(), threadId); procList.Remove(exename); lstbxProcesses.ItemsSource = null; lstbxProcesses.ItemsSource = procList; parent.ProcessStopped(exename); }