C# 实现ping功能
2018-07-20 来源:open-open
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());
}
}
}
}
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。
上一篇:php读取csv文件类
下一篇: php+mysql分页类
最新资讯
热门推荐