代码语言:javascript复制
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
System.Net.NetworkInformation.Ping p = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingOptions option = new System.Net.NetworkInformation.PingOptions();
option.DontFragment = true;
string data = "123456789";
byte[] buffer = Encoding.ASCII.GetBytes(data);
int timeout = 1000;
for (int i = 0; i < 1000; i )
{
System.Net.NetworkInformation.PingReply reply = p.Send("kcs001", timeout);
Console.WriteLine(reply.Status.ToString());
}
}
}
}
</pre>