using System;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
class Program
{
static void Main(string[] args)
{
Ping pingSender = new Ping();
String data = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
byte[] buffer = Encoding.ASCII.GetBytes(data);
int timeout = 120;
Console.Write("Enter IP Address:");
String ip = Console.ReadLine();
PingReply reply = pingSender.Send(ip, timeout, buffer);
if (reply.Status == IPStatus.Success)
{
Console.WriteLine("Address:{0}", reply.Address.ToString());
Console.WriteLine("RoundTrip time: {0}", reply.RoundtripTime);
Console.WriteLine("Time to live: {0}", reply.Options.Ttl);
Console.WriteLine("Don't fragment: {0}", reply.Options.DontFragment);
Console.WriteLine("Buffer size: {0}", reply.Buffer.Length);
}
Console.ReadKey();
}
}
วันพฤหัสบดีที่ 17 พฤศจิกายน พ.ศ. 2554
c# โปรแกรม ping
ป้ายกำกับ:
c# ping
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น