예제 #1
0
        private void AddNewBot(Slave slave)
        {
            // 5 columns right now so far
            // Picture | OS | IP | CPU and RAM | Detected AV's
            //    1       2    3        4             5
            DataGridViewRow row = new DataGridViewRow();

            row.Height = 50;
            DataGridViewCell cell = new DataGridViewTextBoxCell();

            for (var x = 1; x <= 5; x++)
            {
                switch (x)
                {
                case 1:
                    // First column will ALWAYS be the desktop preview image
                    cell       = new DataGridViewImageCell();
                    cell.Value = slave.PreviewImg;
                    row.Cells.Add(cell);
                    break;

                case 2:
                    cell       = new DataGridViewTextBoxCell();
                    cell.Value = slave.OSVersion;
                    row.Cells.Add(cell);
                    break;

                case 3:

                    cell       = new DataGridViewTextBoxCell();
                    cell.Value = slave.IP;
                    row.Cells.Add(cell);
                    break;

                case 4:
                    cell       = new DataGridViewTextBoxCell();
                    cell.Value = $"{slave.ProcessorInfo} | {slave.RamPresent}";
                    row.Cells.Add(cell);
                    break;

                case 5:
                    cell       = new DataGridViewTextBoxCell();
                    cell.Value = slave.ClientID;
                    row.Cells.Add(cell);
                    break;

                case 6:
                    cell       = new DataGridViewTextBoxCell();
                    cell.Value = ClientHandler.GetAVFormatted(slave);
                    row.Cells.Add(cell);
                    break;

                default:
                    break;
                }
            }
            botView.Rows.Add(row);
            SetImageStretch();
        }