没有呀!我的host= "192.168.10.40"用的是IP地址。

解决方案 »

  1.   

    用的Dns.Resolve还是IPAddress.Parse?
    速度应该是相当,嗯
      

  2.   

    static string host = "109.10.5.188";
    static int port = 1000;
    上面
    client.Connect(host,port);并没有使用Dns.Resolve还是IPAddress.Parse。就这个Connect慢。大家都怎么用的?
      

  3.   

    TcpClient.Connect(string,int)的这种重载形式的第一个参数是string,实际上它需要的是个域名,在TcpClient内部使用了Dns.Resolve改成client.Connect(IPAddress.Parse(host),port);
      

  4.   

    反编译System.dll得到:public void Connect(string hostname, int port)
    {
          IPAddress address1;
          int num1;
          if (this.m_CleanedUp)
          {
                throw new ObjectDisposedException(base.GetType().FullName);
          }
          if (hostname == null)
          {
                throw new ArgumentNullException("hostname");
          }
          if (!ValidationHelper.ValidateTcpPort(port))
          {
                throw new ArgumentOutOfRangeException("port");
          }
          if (this.m_Active)
          {
                throw new SocketException(10056);
          }
          IPHostEntry entry1 = Dns.Resolve(hostname);
    ...
      

  5.   

    只不过用了一个反编译工具,没什么,你们下载下来一样用
    http://www.aisto.com/roeder/dotnet
      

  6.   

    Sunmast(速马, Reloading...) ,强人!PF
      

  7.   

    同意 Sunmast(速马, Reloading...)
      

  8.   

    因为.net封装得比较好,内部执行了一些操作,为了其稳定性,当然慢了