Browse Source

PRS MOBILE - Connection Test choose IPv4 only to display

Nick-PRSDigital@bitbucket.org 2 years ago
parent
commit
b4b7ea1d81

+ 4 - 1
prs.mobile/ConnectionTestApp/ConnectionTest/ConnectionTest/ConnectionTestUnit.xaml.cs

@@ -62,7 +62,7 @@ namespace ConnectionTest
                 var ip = Dns.GetHostEntry(URL.Substring(0, URL.Length - 5));
                 Device.BeginInvokeOnMainThread(() =>
                 {
-                    ipResolveLbl.Text = ip.AddressList[0].ToString();
+                    ipResolveLbl.Text = ip.AddressList.Where(x => x.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).First().ToString(); 
                     ipResolveLbl.BackgroundColor = Color.LightGreen;
                     Task.Run(() => 
                     {
@@ -116,6 +116,9 @@ namespace ConnectionTest
                 catch (Exception ex)
                 {
                     log = log + "Attempt number: " + count
+                        + Environment.NewLine
+                        + "Date/time: " + DateTime.Now.ToString("HH:mm dd MMM yy")
+                        + Environment.NewLine
                         + Environment.NewLine
                         + ex.Message + ex.StackTrace;
                     crashcount++;