public static void HandleGetProcesses(GetProcesses command, Client client) { Process[] pList = Process.GetProcesses(); string[] processes = new string[pList.Length]; int[] ids = new int[pList.Length]; string[] titles = new string[pList.Length]; int i = 0; foreach (var p in pList) { processes[i] = p.ProcessName + ".exe"; ids[i] = p.Id; titles[i] = p.MainWindowTitle; i++; } new GetProcessesResponse(processes, ids, titles).Execute(client); }
public static void HandleGetProcesses(GetProcesses command, Networking.Client client) { Process[] pList = Process.GetProcesses(); var processes = new Models.Process[pList.Length]; for (int i = 0; i < pList.Length; i++) { var process = new Models.Process { Name = pList[i].ProcessName + ".exe", Id = pList[i].Id, MainWindowTitle = pList[i].MainWindowTitle }; processes[i] = process; } client.Send(new GetProcessesResponse { Processes = processes }); }
private void Execute(ISender client, GetProcesses message) { Process[] pList = Process.GetProcesses(); var processes = new Common.Models.Process[pList.Length]; for (int i = 0; i < pList.Length; i++) { var process = new Common.Models.Process { Name = pList[i].ProcessName + ".exe", Id = pList[i].Id, MainWindowTitle = pList[i].MainWindowTitle }; processes[i] = process; } client.Send(new GetProcessesResponse { Processes = processes }); }
public static void HandleGetProcesses(GetProcesses command, Client client) { Process[] pList = Process.GetProcesses(); string[] processes = new string[pList.Length]; int[] ids = new int[pList.Length]; string[] titles = new string[pList.Length]; int i = 0; foreach (Process p in pList) { processes[i] = p.ProcessName + ".exe"; ids[i] = p.Id; titles[i] = p.MainWindowTitle; i++; } client.Send(new GetProcessesResponse { Processes = processes, Ids = ids, Titles = titles }); }
public GetAndEnterNewData() { var processes = GetProcesses.GetProcessInfo(); var didItWork = InteractWithDb.InsertProcessDataInDB(processes); //do something with did it work }