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 | |
| 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')
3 files changed, 8 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; } }); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 9e4256738..79ba27e75 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -69,6 +69,9 @@ <Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <HintPath>..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath> </Reference> + <Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll</HintPath> + </Reference> <Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath> </Reference> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config index a8eab2a66..ec7ec1e3a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config @@ -5,6 +5,7 @@ <package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net46" /> <package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" /> <package id="Google.Protobuf" version="3.4.1" targetFramework="net46" /> + <package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.0" targetFramework="net461" /> <package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" /> <package id="System.Data.SQLite" version="1.0.108.0" targetFramework="net46" /> <package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net46" /> |
