我用C#从 1 PING 到 255.每个要是都PING 4次的话。那得等到何年何月。
另外我想扫描整个局域网在线得机器。
我得想法是用ping 然后分析ping后返回得数据。
但是有点慢,如果大侠们有啥好主意得话,不妨慷慨解囊,
小弟不胜感激!

解决方案 »

  1.   

     Ping pingSender = new Ping();
                        PingOptions options = new PingOptions();                    options.DontFragment = true;
                        string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
                        byte[] buffer = Encoding.ASCII.GetBytes(data);
                        int timeout = 120;
                        PingReply reply = pingSender.Send(this.textBox1.Text, timeout, buffer, options);
                        if (reply.Status == IPStatus.Success)
                        {
                            this.textBox2.Text = (reply.Address.ToString()) + "\r\n";
                            this.textBox2.Text+= (reply.RoundtripTime) + "\r\n";                      
                        }
      

  2.   

    this.textBox1.Text ---ip或网址
    this.textBox2.Text ---输出信息
      

  3.   

    ping -n count '地址'count = 1 就是1次
      

  4.   

    LS有道理不过命令中都有ping 的次数的,程序应该也能控制,不过不建议,这么做,
      

  5.   

    ping 192.168.1.1 -n 1