Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var cmd = new CommandArgs(string.Join(" ", args));

            if (!cmd.ContainsKey("name"))
            {
                Console.WriteLine("Usage: -name=ABC");
                // Console.ReadKey();
                return;
            }

            var deviceName = cmd.GetValue("name", "Default");
            
            var original = Console.ForegroundColor;
            RegisterDevice(deviceName).Wait();
            Console.ForegroundColor = original;
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var cmd = new CommandArgs(string.Join(" ", args));

            if (!cmd.ContainsKey("name"))
            {
                Console.WriteLine("Usage: -name ABC (-hub inbox -bus iot-bus)");
                // Console.ReadKey();
                return;
            }

            var deviceName = cmd.GetValue("name", "Default");
            var eventHubName = cmd.GetValue("hub", Constants.DefaultHubName);
            var serviceBus = cmd.GetValue("bus", Constants.DefaultBusName);
            var original = Console.ForegroundColor;
            CreateHashForDevice(deviceName, eventHubName, serviceBus);
            Console.ForegroundColor = original;
            Console.ReadKey();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var cmd = new CommandArgs(args);

            if (!cmd.ContainsKey("hash") || !cmd.ContainsKey("name"))
            {
                Console.WriteLine("Usage: -name ABC -hash ALPHA");
                Console.ReadLine();
                return;
            }

            var deviceName = cmd.GetValue("name", "default");
            var hash = cmd.GetValue("hash", null);
            var eventHubName = cmd.GetValue("hub", Constants.DefaultHubName);
            var serviceBus = cmd.GetValue("bus", Constants.DefaultBusName);

            Console.WriteLine("Press Ctrl-C to stop the sender process");
            Console.WriteLine("Press Enter to start now");
            Console.ReadLine();

            SendingRandomMessages(deviceName, hash, eventHubName, serviceBus);
        }