Detect if Windows Phone 7 is connected to desktop Zune software

前端 未结 3 1491
别跟我提以往
别跟我提以往 2021-01-14 03:35

I\'ve been working on a Windows Phone 7 app for a few months now and have a collection of useful detection flags that are used to test for things like if the code is running

3条回答
  •  佛祖请我去吃肉
    2021-01-14 04:22

    Testing for NetworkInterfaceType being Ethernet gets you close, but not quite there - as this isn't sensitive to the status of Zune vs WPConnect for the connection. Also, reading NetworkInterfaceType also can prove to be less than a walk in the park.

    Handling the resulting exception seems to be the reliable method, however the exception does appear to vary between some media APIs, so keep an eye out for that.

提交回复
热议问题