Quellcode durchsuchen

added try catch to password check

Karel van Waveren vor 10 Jahren
Ursprung
Commit
7ade1768dd
1 geänderte Dateien mit 10 neuen und 3 gelöschten Zeilen
  1. 10 3
      Proftaak Remote Healthcare/FietsClientV2/TCPConnection.cs

+ 10 - 3
Proftaak Remote Healthcare/FietsClientV2/TCPConnection.cs

@@ -290,10 +290,17 @@ namespace FietsClient
 
         public void SendString(string s)
         {
+            try
+            {
+                byte[] b = Encoding.ASCII.GetBytes(s);
+                sslStream.Write(b, 0, b.Length);
+                sslStream.Flush();
+            }
+            catch (Exception e)
 
-            byte[] b = Encoding.ASCII.GetBytes(s);
-            sslStream.Write(b, 0, b.Length);
-            sslStream.Flush();
+            {
+                Console.WriteLine(e);
+            }
         }
     }
 }