|
|
|
|
@ -147,15 +147,19 @@ public static class HelperMethods
|
|
|
|
|
public static bool IsConnectedToInternet()
|
|
|
|
|
{
|
|
|
|
|
log.Info("Checking internet connection...");
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
PingReply pingReply = new Ping().Send("github.com");
|
|
|
|
|
if (pingReply?.Status != IPStatus.Success)
|
|
|
|
|
if (pingReply?.Status == IPStatus.Success)
|
|
|
|
|
{
|
|
|
|
|
log.Info("Internet connection failed.");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
log.Info("Internet connection established!");
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch { /* ignoring exceptions */ }
|
|
|
|
|
log.Info("Internet connection failed.");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets <paramref name="languageText"/> and replaces "$NAME" with <paramref name="replacementText"/>.
|
|
|
|
|
|