private void MqttCameraSlide(string folder) { var rand = new Random(); var files = Directory.GetFiles(folder, "*.jpg"); string topic = "slideshow"; _mqtt.PublishByte(topic, File.ReadAllBytes(files[rand.Next(files.Length)])); }