How do I check whether a WP8 device uses wifi, mobile plan or roaming to load data

后端 未结 3 1578
悲&欢浪女
悲&欢浪女 2020-12-20 07:03

I plan to load only as much data as required in my app. Which means, that when the data is loaded via Wifi, I want to prefetch things. If the data is loaded via mobile plan

3条回答
  •  清歌不尽
    2020-12-20 07:44

    Have you tried the System.Net.NetworkInformation namespace on WP8. This package has a static method which returns the network status. You can then switch based on this information

    NetworkInterface.NetworkInterfaceType

    More details can be found here

提交回复
热议问题