如题目.我运行如下程序
using System;
using System.Net.Sockets;
using System.Net;class PortSearch
{
    static void Main()
    {
        Console.WriteLine("enter the IP adress:");
        string strIP;
        strIP = Console.ReadLine();
        Console.WriteLine("enter the start port:");
        int startPort = int.Parse(Console.ReadLine());
        Console.WriteLine("enter the end port:");
        int endPort = int.Parse(Console.ReadLine());
        for (int i = startPort; i <= endPort; i++)
        {
            TcpClient myTcpClient = new TcpClient();
            try
            {
                myTcpClient.Connect(strIP,i);
                Console.WriteLine("port" + i.ToString() + "is open");
                myTcpClient.Close();
            }
            catch(SocketException e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("port" + i.ToString() + " is close");
            }
           
        }
        Console.WriteLine("complete");
        Console.ReadLine();    }
}输入自己的IP地址,或者是127.0.0.1,又或者localhost
然后端口由21监听到100.
它只有21这一个端口是开的,其余都是如题的出错信息.
我试了很多端口都是这样,不知道为什么.我连防火场都关了,但是还是没用.请高手求救啊!!!!!