diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-03-10 15:16:39 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-03-10 15:16:39 +0200 |
| commit | 59d8d9f374dd6b2dc5ef938a5fb1ddece1d47c43 (patch) | |
| tree | 68d83b9c6dabc426e8f204e8849ddbfc5e1d45aa /Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity | |
| parent | 3dfab420fe594d83c5382107b4f80bdeab9ddc44 (diff) | |
| download | Tango-59d8d9f374dd6b2dc5ef938a5fb1ddece1d47c43.tar.gz Tango-59d8d9f374dd6b2dc5ef938a5fb1ddece1d47c43.zip | |
Changed PPC internet connection check based on windows report.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs index 5218d9f70..a2275a72d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.WindowsAPICodePack.Net; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; @@ -269,15 +270,11 @@ namespace Tango.PPC.UI.Connectivity { try { - using (var client = new WebClient()) - using (client.OpenRead("http://clients3.google.com/generate_204")) - { - return true; - } + return NetworkListManager.GetNetworks(NetworkConnectivityLevels.Connected).Any(x => x.IsConnectedToInternet); } catch { - return false; + return true; } }); } |
