This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
string IpAddress = "127.0.0.1"; | |
for (int CurrPort = 79; CurrPort <= 85; CurrPort++) | |
{ | |
TcpClient TcpScan = new TcpClient(); | |
try | |
{ | |
TcpScan.Connect(IpAddress, CurrPort); | |
Console.WriteLine("Port " + CurrPort + " open"); | |
} | |
catch | |
{ | |
// An exception occured, thus the port is probably closed | |
//Console.Write("Port " + CurrPort + " closed"); | |
} | |
} | |
} |