9.3.7. Пример интеграции службы RobotNET Ping

sdk\c-sharp\ping\ping\Program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using RobotNET.SDK;

namespace RoboPing
{
    class Program
    {
        static void Main( string[] args )
        {
            Console.WriteLine( string.Format( "Program started!" ) );

            if( args.Count() > 1 )
            {
                string addr = args[0];
                string pass = args[1];

                try
                {
                    using( Ping ping = new Ping( addr, pass, uint.MaxValue ) )
                    {
                        ping.PingIt( 32, 32 );

                        Console.WriteLine( "OK" );
                    }
                }
                catch( Exception e )
                {
                    Console.WriteLine( e.ToString() );
                }
            }

            Console.WriteLine( string.Format( "Program finished!" ) );
        }
    }
}