Last active
June 30, 2022 23:04
-
-
Save hatsunea/713e9cd7952d700c23754cc1e50c6a86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Azure IoT Hub 接続 | |
var azureCert = new X509Certificate(Resource.GetBytes(Resource.BinaryResources.BaltimoreCyberTrustRoot)); | |
Client = new DeviceClient(HostName, DeviceId, SharedAccessKey, azureCert: azureCert); | |
while (true) | |
{ | |
try | |
{ | |
if (Client.Open()) break; | |
} | |
catch | |
{ | |
Console.CursorTop--; Console.WriteLine($" > Connect Faild"); | |
Thread.Sleep(1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment