static void Main()

in dotnet/Awsiotdevicepubhttp/Awsiotdevicepubhttp/Program.cs [14:33]


        static void Main(string[] args)
        {
            var clientCert = new X509Certificate2(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "certificate.cert.pfx"), "MyPassword1");

            string requestUri = @"https://<<your-iot-endpoint>>:8443/topics/iotbutton/virtualButton?qos=1";

            while (true)
            {
                Thermostat thermostat = new Thermostat();

                Random random = new Random();
                thermostat.ThermostatID = random.Next(10000);
                thermostat.SetPoint = random.Next(32, 100);
                thermostat.CurrentTemperature = random.Next(32, 100);

                InvokeHttpPost(requestUri, clientCert, thermostat);

                Thread.Sleep(5000);
            }
        }