みむらです。これは完全にメモ書き。
・・・検証環境がないので実験できていませんが(ぉぃ
環境:
Windows 8
.net Framework 4.5
要求:
・インターネットにつながってる
・容量制限や従量課金の回線じゃないことを判定する。
コード:
var profile = NetworkInformation.GetInternetConnectionProfile();
if (profile != null)
{
if (profile.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess
&& profile.GetConnectionCost().NetworkCostType == NetworkCostType.Unrestricted)
{
// ほげほげ
}
}
やっぱり、回線を気にして通信させたいよね、とふと。
あとで組み込もう。