如何解决VPN上的网络连接检查问题?

时间:2019-03-20 12:36:22

标签: c# windows uwp windows-10-universal internet-connection

我正在使用一段C#代码,用于检查我的PC是否通过VPN 可以访问互联网

var profile = NetworkInformation.GetInternetConnectionProfile();
if (profile != null)
{
        // returning True/False
        var IsInternetAvailabele= profile.GetNetworkConnectivityLevel() >= NetworkConnectivityLevel.InternetAccess;
        // .......
        // .......
        //.. Some Other Code..
}

在我的Windows 10的{​​{1}}版本上运行良好。收到来自1803的更新后,我的Microsoft版本从Windows 10更新为v1803

v1809的先前版本上:

Windows 10 v1803

但是在升级var profile = NetworkInformation.GetInternetConnectionProfile(); var value = profile.GetNetworkConnectivityLevel(); // returning "Internet Access" 之后:

Windows 10 v1809

但是我的Internet浏览在var profile = NetworkInformation.GetInternetConnectionProfile(); var value = profile.GetNetworkConnectivityLevel(); // returning "Local Access" (No Internet Access) 上工作正常。我尝试重新启动计算机,重置browsers,更新Windows10。但是一切都是徒劳的。

是新版本中的network adapter错误还是其他原因!

注意:此问题仅通过VPN发生。在Windows 10的旧版本中,不存在此问题。

0 个答案:

没有答案