static void Main(string[] args) { Ping ping = new Ping(); PingOptions pingOption = new PingOptions(50, true); string data = " you are a such a beautiful girl"; byte[] buffer = Encoding.ASCII.GetBytes(data); PingReply pingReply = ping.Send("192.168.1.100", 20, buffer);
if (pingReply.Status == IPStatus.Success) { Console.WriteLine("address:{0}", pingReply.Address.ToString()); Console.WriteLine("Round Trip time {0}", pingReply.RoundtripTime); Console.WriteLine("time to live:{0}", pingReply.Options.Ttl); Console.WriteLine("Do not to fragement:{0}", pingReply.Options.DontFragment); } Console.ReadKey(); } |
Ping 程序C#实现方法二
最新推荐文章于 2021-11-11 09:39:50 发布