private void PortScan(string Search, int start, int end) { tbInfo.AppendText("\r\n\r\nOpen Ports:"); for (int Port = start; Port <= end; Port++) { TcpClient TcpScan = new TcpClient(); tbStatus.Text = "Scanning Port: " + Port; try { TcpScan.Connect(Search, Port); tbInfo.AppendText("\r\n" + Port); } catch { tbStatus.Text = "Port " + Port + " Closed."; } } }