From 72b431630d01f7a4a342a8d23b141ea56b1e73ea Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Sat, 19 Jan 2019 10:17:07 +0100 Subject: [PATCH] Fix try/catch in caso di conf server con IP su net impossibile (ping --> exc) --- IOB-WIN/MainForm.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/IOB-WIN/MainForm.cs b/IOB-WIN/MainForm.cs index ade5de4d..41fa481b 100644 --- a/IOB-WIN/MainForm.cs +++ b/IOB-WIN/MainForm.cs @@ -339,8 +339,15 @@ namespace IOB_WIN address = IPAddress.Loopback; string ipAdrr = MPIP; IPAddress.TryParse(ipAdrr, out address); - reply = pingSender.Send(address, 100); - answ = reply.Status; + try + { + reply = pingSender.Send(address, 100); + answ = reply.Status; + } + catch (Exception exc) + { + lgError(string.Format("testPingServer() EXCEPTION in fase di ping{0}{1}{2}", Environment.NewLine, exc)); + } return answ; } /// @@ -727,7 +734,7 @@ namespace IOB_WIN MainProgrBar.Invalidate(); } } - catch(Exception exc) + catch (Exception exc) { } } ///