<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FNetwork%2FPing</id>
		<title>Csharp/C Sharp/Network/Ping - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FNetwork%2FPing"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Network/Ping&amp;action=history"/>
		<updated>2026-04-29T17:54:08Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Network/Ping&amp;diff=1448&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Network/Ping&amp;diff=1448&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Network/Ping&amp;diff=1449&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Network/Ping&amp;diff=1449&amp;oldid=prev"/>
				<updated>2010-05-26T11:46:04Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Advanced Ping Program==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
C# Network Programming &lt;br /&gt;
by Richard Blum&lt;br /&gt;
Publisher: Sybex &lt;br /&gt;
ISBN: 0782141765&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Net;&lt;br /&gt;
using System.Net.Sockets;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Threading;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class AdvPing : Form&lt;br /&gt;
{&lt;br /&gt;
   private static int pingstart, pingstop, elapsedtime;&lt;br /&gt;
   private static TextBox hostbox, databox;&lt;br /&gt;
   private static ListBox results;&lt;br /&gt;
   private static Thread pinger;&lt;br /&gt;
   private static Socket sock;&lt;br /&gt;
   public AdvPing()&lt;br /&gt;
   {&lt;br /&gt;
      Text = &amp;quot;Advanced Ping Program&amp;quot;;&lt;br /&gt;
      Size = new Size(400, 380);&lt;br /&gt;
      Label label1 = new Label();&lt;br /&gt;
      label1.Parent = this;&lt;br /&gt;
      label1.Text = &amp;quot;Enter host to ping:&amp;quot;;&lt;br /&gt;
      label1.AutoSize = true;&lt;br /&gt;
      label1.Location = new Point(10, 30);&lt;br /&gt;
      hostbox = new TextBox();&lt;br /&gt;
      hostbox.Parent = this;&lt;br /&gt;
      hostbox.Size = new Size(200, 2 * Font.Height);&lt;br /&gt;
      hostbox.Location = new Point(10, 55);&lt;br /&gt;
      results = new ListBox();&lt;br /&gt;
      results.Parent = this;&lt;br /&gt;
      results.Location = new Point(10, 85);&lt;br /&gt;
      results.Size = new Size(360, 18 * Font.Height);&lt;br /&gt;
      Label label2 = new Label();&lt;br /&gt;
      label2.Parent = this;&lt;br /&gt;
      label2.Text = &amp;quot;Packet data:&amp;quot;;&lt;br /&gt;
      label2.AutoSize = true;&lt;br /&gt;
      label2.Location = new Point(10, 330);&lt;br /&gt;
      databox = new TextBox();&lt;br /&gt;
      databox.Parent = this;&lt;br /&gt;
      databox.Text = &amp;quot;test packet&amp;quot;;&lt;br /&gt;
      databox.Size = new Size(200, 2 * Font.Height);&lt;br /&gt;
      databox.Location = new Point(80, 325);&lt;br /&gt;
      Button sendit = new Button();&lt;br /&gt;
      sendit.Parent = this;&lt;br /&gt;
      sendit.Text = &amp;quot;Start&amp;quot;;&lt;br /&gt;
      sendit.Location = new Point(220,52);&lt;br /&gt;
      sendit.Size = new Size(5 * Font.Height, 2 * Font.Height);&lt;br /&gt;
      sendit.Click += new EventHandler(ButtonSendOnClick);&lt;br /&gt;
      Button stopit = new Button();&lt;br /&gt;
      stopit.Parent = this;&lt;br /&gt;
      stopit.Text = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
      stopit.Location = new Point(295,52);&lt;br /&gt;
      stopit.Size = new Size(5 * Font.Height, 2 * Font.Height);&lt;br /&gt;
      stopit.Click += new EventHandler(ButtonStopOnClick);&lt;br /&gt;
      Button closeit = new Button();&lt;br /&gt;
      closeit.Parent = this;&lt;br /&gt;
      closeit.Text = &amp;quot;Close&amp;quot;;&lt;br /&gt;
      closeit.Location = new Point(300, 320);&lt;br /&gt;
      closeit.Size = new Size(5 * Font.Height, 2 * Font.Height);&lt;br /&gt;
      closeit.Click += new EventHandler(ButtonCloseOnClick);&lt;br /&gt;
      sock = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Icmp);&lt;br /&gt;
      sock.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 3000);&lt;br /&gt;
   }&lt;br /&gt;
   void ButtonSendOnClick(object obj, EventArgs ea)&lt;br /&gt;
   {&lt;br /&gt;
      pinger = new Thread(new ThreadStart(sendPing));&lt;br /&gt;
      pinger.IsBackground = true;&lt;br /&gt;
      pinger.Start();&lt;br /&gt;
   }&lt;br /&gt;
   void ButtonStopOnClick(object obj, EventArgs ea)&lt;br /&gt;
   {&lt;br /&gt;
      pinger.Abort();&lt;br /&gt;
   }&lt;br /&gt;
   void ButtonCloseOnClick(object obj, EventArgs ea)&lt;br /&gt;
   {&lt;br /&gt;
      sock.Close();&lt;br /&gt;
      Close();&lt;br /&gt;
   }&lt;br /&gt;
   void sendPing()&lt;br /&gt;
   {&lt;br /&gt;
      IPHostEntry iphe = Dns.Resolve(hostbox.Text);&lt;br /&gt;
      IPEndPoint iep = new IPEndPoint(iphe.AddressList[0], 0);&lt;br /&gt;
      EndPoint ep = (EndPoint)iep;&lt;br /&gt;
      ICMP packet = new ICMP();&lt;br /&gt;
      int recv, i = 1;&lt;br /&gt;
      packet.Type = 0x08;&lt;br /&gt;
      packet.Code = 0x00;&lt;br /&gt;
      Buffer.BlockCopy(BitConverter.GetBytes(1), 0, packet.Message, 0, 2);&lt;br /&gt;
      byte[] data = Encoding.ASCII.GetBytes(databox.Text);&lt;br /&gt;
      Buffer.BlockCopy(data, 0, packet.Message, 4, data.Length);&lt;br /&gt;
      packet.MessageSize = data.Length + 4;&lt;br /&gt;
      int packetsize = packet.MessageSize + 4;&lt;br /&gt;
      results.Items.Add(&amp;quot;Pinging &amp;quot; + hostbox.Text);&lt;br /&gt;
      while(true)&lt;br /&gt;
      {&lt;br /&gt;
         packet.Checksum = 0;&lt;br /&gt;
         Buffer.BlockCopy(BitConverter.GetBytes(i), 0, packet.Message, 2, 2);&lt;br /&gt;
         UInt16 chcksum = packet.getChecksum();&lt;br /&gt;
         packet.Checksum = chcksum;&lt;br /&gt;
         pingstart = Environment.TickCount;&lt;br /&gt;
         sock.SendTo(packet.getBytes(), packetsize, SocketFlags.None, iep);&lt;br /&gt;
         try&lt;br /&gt;
         {&lt;br /&gt;
            data = new byte[1024];&lt;br /&gt;
            recv = sock.ReceiveFrom(data, ref ep);&lt;br /&gt;
            pingstop = Environment.TickCount;&lt;br /&gt;
            elapsedtime = pingstop - pingstart;&lt;br /&gt;
            results.Items.Add(&amp;quot;reply from: &amp;quot; + ep.ToString() + &amp;quot;, seq: &amp;quot; + i +&lt;br /&gt;
                      &amp;quot;, time = &amp;quot; + elapsedtime + &amp;quot;ms&amp;quot;);&lt;br /&gt;
         } catch (SocketException)&lt;br /&gt;
         {&lt;br /&gt;
            results.Items.Add(&amp;quot;no reply from host&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
         i++;&lt;br /&gt;
         Thread.Sleep(3000);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      Application.Run(new AdvPing());&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
class ICMP&lt;br /&gt;
{&lt;br /&gt;
   public byte Type;&lt;br /&gt;
   public byte Code;&lt;br /&gt;
   public UInt16 Checksum;&lt;br /&gt;
   public int MessageSize;&lt;br /&gt;
   public byte[] Message = new byte[1024];&lt;br /&gt;
   public ICMP()&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
   public ICMP(byte[] data, int size)&lt;br /&gt;
   {&lt;br /&gt;
      Type = data[20];&lt;br /&gt;
      Code = data[21];&lt;br /&gt;
      Checksum = BitConverter.ToUInt16(data, 22);&lt;br /&gt;
      MessageSize = size - 24;&lt;br /&gt;
      Buffer.BlockCopy(data, 24, Message, 0, MessageSize);&lt;br /&gt;
   }&lt;br /&gt;
   public byte[] getBytes()&lt;br /&gt;
   {&lt;br /&gt;
      byte[] data = new byte[MessageSize + 9];&lt;br /&gt;
      Buffer.BlockCopy(BitConverter.GetBytes(Type), 0, data, 0, 1);&lt;br /&gt;
      Buffer.BlockCopy(BitConverter.GetBytes(Code), 0, data, 1, 1);&lt;br /&gt;
      Buffer.BlockCopy(BitConverter.GetBytes(Checksum), 0, data, 2, 2);&lt;br /&gt;
      Buffer.BlockCopy(Message, 0, data, 4, MessageSize);&lt;br /&gt;
      return data;&lt;br /&gt;
   }&lt;br /&gt;
   public UInt16 getChecksum()&lt;br /&gt;
   {&lt;br /&gt;
      UInt32 chcksm = 0;&lt;br /&gt;
      byte[] data = getBytes();&lt;br /&gt;
      int packetsize = MessageSize + 8;&lt;br /&gt;
      int index = 0;&lt;br /&gt;
      while ( index &amp;lt; packetsize)&lt;br /&gt;
      {&lt;br /&gt;
         chcksm += Convert.ToUInt32(BitConverter.ToUInt16(data, index));&lt;br /&gt;
         index += 2;&lt;br /&gt;
      }&lt;br /&gt;
      chcksm = (chcksm &amp;gt;&amp;gt; 16) + (chcksm &amp;amp; 0xffff);&lt;br /&gt;
      chcksm += (chcksm &amp;gt;&amp;gt; 16);&lt;br /&gt;
      return (UInt16)(~chcksm);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ping and PingReply==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Net.NetworkInformation;&lt;br /&gt;
class MainClass {&lt;br /&gt;
    public static void Main(string[] args) {&lt;br /&gt;
        using (Ping ping = new Ping()) {&lt;br /&gt;
            foreach (string comp in args) {&lt;br /&gt;
                try {&lt;br /&gt;
                    Console.Write(&amp;quot;    {0}...&amp;quot;, comp);&lt;br /&gt;
                    PingReply reply = ping.Send(comp, 100);&lt;br /&gt;
                    if (reply.Status == IPStatus.Success) {&lt;br /&gt;
                        Console.WriteLine(&amp;quot;Success - IP Address:{0}&amp;quot;, reply.Address, reply.RoundtripTime);&lt;br /&gt;
                    } else {&lt;br /&gt;
                        Console.WriteLine(reply.Status);&lt;br /&gt;
                    }&lt;br /&gt;
                } catch (Exception ex) {&lt;br /&gt;
                    Console.WriteLine(&amp;quot;Error ({0})&amp;quot;,&lt;br /&gt;
                        ex.InnerException.Message);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ping Success and Send==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Net.NetworkInformation;&lt;br /&gt;
class MainClass {&lt;br /&gt;
    public static void Main(string[] args) {&lt;br /&gt;
        using (Ping ping = new Ping()) {&lt;br /&gt;
            Console.WriteLine(&amp;quot;Pinging:&amp;quot;);&lt;br /&gt;
            foreach (string comp in args) {&lt;br /&gt;
                try {&lt;br /&gt;
                    Console.Write(&amp;quot;    {0}...&amp;quot;, comp);&lt;br /&gt;
                    PingReply reply = ping.Send(comp, 100);&lt;br /&gt;
                    if (reply.Status == IPStatus.Success) {&lt;br /&gt;
                        Console.WriteLine(&amp;quot;Success - IP Address:{0}&amp;quot;, reply.Address, reply.RoundtripTime);&lt;br /&gt;
                    } else {&lt;br /&gt;
                        Console.WriteLine(reply.Status);&lt;br /&gt;
                    }&lt;br /&gt;
                } catch (Exception ex) {&lt;br /&gt;
                    Console.WriteLine(&amp;quot;Error ({0})&amp;quot;,&lt;br /&gt;
                        ex.InnerException.Message);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Simple Ping==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
C# Network Programming &lt;br /&gt;
by Richard Blum&lt;br /&gt;
Publisher: Sybex &lt;br /&gt;
ISBN: 0782141765&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Net;&lt;br /&gt;
using System.Net.Sockets;&lt;br /&gt;
using System.Text;&lt;br /&gt;
public class SimplePing&lt;br /&gt;
{&lt;br /&gt;
   public static void Main(string[] argv)&lt;br /&gt;
   {&lt;br /&gt;
      byte[] data = new byte[1024];&lt;br /&gt;
      int recv;&lt;br /&gt;
      Socket host = new Socket(AddressFamily.InterNetwork, SocketType.Raw,&lt;br /&gt;
                 ProtocolType.Icmp);&lt;br /&gt;
      IPEndPoint iep = new IPEndPoint(IPAddress.Parse(argv[0]), 0);&lt;br /&gt;
      EndPoint ep = (EndPoint)iep;&lt;br /&gt;
      ICMP packet = new ICMP();&lt;br /&gt;
      packet.Type = 0x08;&lt;br /&gt;
      packet.Code = 0x00;&lt;br /&gt;
      packet.Checksum = 0;&lt;br /&gt;
      Buffer.BlockCopy(BitConverter.GetBytes((short)1), 0, packet.Message, 0, 2);&lt;br /&gt;
      Buffer.BlockCopy(BitConverter.GetBytes((short)1), 0, packet.Message, 2, 2);&lt;br /&gt;
      data = Encoding.ASCII.GetBytes(&amp;quot;test packet&amp;quot;);&lt;br /&gt;
      Buffer.BlockCopy(data, 0, packet.Message, 4, data.Length);&lt;br /&gt;
      packet.MessageSize = data.Length + 4;&lt;br /&gt;
      int packetsize = packet.MessageSize + 4;&lt;br /&gt;
      UInt16 chcksum = packet.getChecksum();&lt;br /&gt;
      packet.Checksum = chcksum;&lt;br /&gt;
      host.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 3000);&lt;br /&gt;
      host.SendTo(packet.getBytes(), packetsize, SocketFlags.None, iep);&lt;br /&gt;
      try&lt;br /&gt;
      {&lt;br /&gt;
         data = new byte[1024];&lt;br /&gt;
         recv = host.ReceiveFrom(data, ref ep);&lt;br /&gt;
      } catch (SocketException)&lt;br /&gt;
      {&lt;br /&gt;
         Console.WriteLine(&amp;quot;No response from remote host&amp;quot;);&lt;br /&gt;
         return;&lt;br /&gt;
      }&lt;br /&gt;
      ICMP response = new ICMP(data, recv);&lt;br /&gt;
      Console.WriteLine(&amp;quot;response from: {0}&amp;quot;, ep.ToString());&lt;br /&gt;
      Console.WriteLine(&amp;quot;  Type {0}&amp;quot;, response.Type);&lt;br /&gt;
      Console.WriteLine(&amp;quot;  Code: {0}&amp;quot;, response.Code);&lt;br /&gt;
      int Identifier = BitConverter.ToInt16(response.Message, 0);&lt;br /&gt;
      int Sequence = BitConverter.ToInt16(response.Message, 2);&lt;br /&gt;
      Console.WriteLine(&amp;quot;  Identifier: {0}&amp;quot;, Identifier);&lt;br /&gt;
      Console.WriteLine(&amp;quot;  Sequence: {0}&amp;quot;, Sequence);&lt;br /&gt;
      string stringData = Encoding.ASCII.GetString(response.Message, 4, response.MessageSize - 4);&lt;br /&gt;
      Console.WriteLine(&amp;quot;  data: {0}&amp;quot;, stringData);&lt;br /&gt;
      &lt;br /&gt;
      host.Close();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
class ICMP&lt;br /&gt;
{&lt;br /&gt;
   public byte Type;&lt;br /&gt;
   public byte Code;&lt;br /&gt;
   public UInt16 Checksum;&lt;br /&gt;
   public int MessageSize;&lt;br /&gt;
   public byte[] Message = new byte[1024];&lt;br /&gt;
   public ICMP()&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
   public ICMP(byte[] data, int size)&lt;br /&gt;
   {&lt;br /&gt;
      Type = data[20];&lt;br /&gt;
      Code = data[21];&lt;br /&gt;
      Checksum = BitConverter.ToUInt16(data, 22);&lt;br /&gt;
      MessageSize = size - 24;&lt;br /&gt;
      Buffer.BlockCopy(data, 24, Message, 0, MessageSize);&lt;br /&gt;
   }&lt;br /&gt;
   public byte[] getBytes()&lt;br /&gt;
   {&lt;br /&gt;
      byte[] data = new byte[MessageSize + 9];&lt;br /&gt;
      Buffer.BlockCopy(BitConverter.GetBytes(Type), 0, data, 0, 1);&lt;br /&gt;
      Buffer.BlockCopy(BitConverter.GetBytes(Code), 0, data, 1, 1);&lt;br /&gt;
      Buffer.BlockCopy(BitConverter.GetBytes(Checksum), 0, data, 2, 2);&lt;br /&gt;
      Buffer.BlockCopy(Message, 0, data, 4, MessageSize);&lt;br /&gt;
      return data;&lt;br /&gt;
   }&lt;br /&gt;
   public UInt16 getChecksum()&lt;br /&gt;
   {&lt;br /&gt;
      UInt32 chcksm = 0;&lt;br /&gt;
      byte[] data = getBytes();&lt;br /&gt;
      int packetsize = MessageSize + 8;&lt;br /&gt;
      int index = 0;&lt;br /&gt;
      while ( index &amp;lt; packetsize)&lt;br /&gt;
      {&lt;br /&gt;
         chcksm += Convert.ToUInt32(BitConverter.ToUInt16(data, index));&lt;br /&gt;
         index += 2;&lt;br /&gt;
      }&lt;br /&gt;
      chcksm = (chcksm &amp;gt;&amp;gt; 16) + (chcksm &amp;amp; 0xffff);&lt;br /&gt;
      chcksm += (chcksm &amp;gt;&amp;gt; 16);&lt;br /&gt;
      return (UInt16)(~chcksm);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Success==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Net.NetworkInformation;&lt;br /&gt;
class MainClass {&lt;br /&gt;
    public static void Main(string[] args) {&lt;br /&gt;
        using (Ping ping = new Ping()) {&lt;br /&gt;
            Console.WriteLine(&amp;quot;Pinging:&amp;quot;);&lt;br /&gt;
            foreach (string comp in args) {&lt;br /&gt;
                try {&lt;br /&gt;
                    Console.Write(&amp;quot;    {0}...&amp;quot;, comp);&lt;br /&gt;
                    PingReply reply = ping.Send(comp, 100);&lt;br /&gt;
                    if (reply.Status == IPStatus.Success) {&lt;br /&gt;
                        Console.WriteLine(&amp;quot;Success - IP Address:{0}&amp;quot;, reply.Address, reply.RoundtripTime);&lt;br /&gt;
                    } else {&lt;br /&gt;
                        Console.WriteLine(reply.Status);&lt;br /&gt;
                    }&lt;br /&gt;
                } catch (Exception ex) {&lt;br /&gt;
                    Console.WriteLine(&amp;quot;Error ({0})&amp;quot;,&lt;br /&gt;
                        ex.InnerException.Message);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>