[C#] 포트가 열려있는지 확인

using System; using System.Text; using System.Net.Sockets; using System.Net.NetworkInformation; using System.Net; public class CheckPort { public static void Main(string[] args) { try { if (args.Length < 1) { Console.WriteLine(“Usage : CheckPort.exe [IP] [Port]”); Console.WriteLine(” CheckPort.exe 192.168.0.1 80″); return; } string ip = args[0]; int port = Convert.ToInt32(args[1]); if (PingTest(ip)) { Console.WriteLine(“{0} PING OK”, ip); if (ConnectTest(ip, […]