私は次の方法を持っています:
public static bool IsNetworkConnected()
{
ConnectionProfile InternetConnectionProfile = NetworkInformation.GetInternetConnectionProfile();
IReadOnlyList<ConnectionProfile> connectionProfile = NetworkInformation.GetConnectionProfiles();
if (InternetConnectionProfile == null)
return false;
else
return true;
}
通常の方法でインターネットに接続している場合 (LAN ケーブルまたは Wi-Fi 経由) は問題なく動作します。3G USB モデムを使用している場合、false ( InternectConnectionProfile
is null) が返されます。何故ですか?どうすれば修正できますか?