public void AddNewListener(ScanObject Result) { CsgoListenerObject Listener = new CsgoListenerObject(Result); ListenerList.Add(Listener); RefreshListenerListBox(); }
private void DoScan() { while (true) { if (ScanList.Count >= 1) { ScanObject CurScan = ScanList[0]; bool IsOpen = NetScanManager.IsPortOpen(CurScan.Hostname, CurScan.Port); Console.WriteLine("The " + CurScan.Port + " Is" + IsOpen.ToString()); if (IsOpen) { ScanResultBox.Items.Add(CurScan); } ScanList.RemoveAt(0); ScanStatusLabel.Text = "Scan left: " + ScanList.Count; } if (ScanList.Count == 0) { if (DoingScan) { DoingScan = false; MessageBox.Show("Scan complete!"); ScanStatusLabel.Text = "Scan left: 0"; } } Thread.Sleep(500); } }
private void AddAllButton_Click(object sender, EventArgs e) { foreach (object Obj in ScanResultBox.Items) { ScanObject ScanObj = (ScanObject)Obj; AddNewListener(ScanObj); } }
private void AddResultButton_Click(object sender, EventArgs e) { if (ScanResultBox.SelectedItem != null) { ScanObject Selected = (ScanObject)ScanResultBox.SelectedItem; AddNewListener(Selected); } }
public CsgoListenerObject(ScanObject Input) { this.Hostname = Input.Hostname; this.Port = Input.Port; Init(); }