public AgentProcessOverview(RCS_Process_List_Response processResponce, IPAddress ip) { InitializeComponent(); this.AgentProcessOverviewName.Content = processResponce.ClientName; this.AgentProcessOverviewIP.Content = ip.ToString(); foreach (ProcessDescription pd in processResponce.ProcesseList.Processes) { Image i = new Image(); i.Source = ImageHandler.ImageHandler.BytesToImage(pd.WindowPicture); i.Height = 100; i.Width = 100; i.Margin = new Thickness(2); this.AgentProcessOverviewStackPanel.Children.Add(i); } }
/// <summary> /// Responds with a list of the running processes that have a window. /// </summary> private void HandleProcessListRequest() { RCS_Process_List_Response response = new RCS_Process_List_Response(this.GetProcessList(this.previewImageSize), Environment.MachineName, RemoteType.Agent); byte[] responseMsg = Remote_Content_Show_MessageGenerator.GetMessageAsByte(response); byte[] responseHeader = new Remote_Content_Show_Header(MessageCode.MC_Process_List_Response, responseMsg.Length, RemoteType.Agent).ToByte; try { this.stream.Write(responseHeader, 0, responseHeader.Length); this.stream.Write(responseMsg, 0, responseMsg.Length); this.stream.Flush(); } catch { } }