How can I check if a Windows 8 device is currently sending/receiving data on an wifi/mobile data connection?

StackOverflow https://stackoverflow.com/questions/13256737

سؤال

I want to see if there is mobile data activity. How can I do this using the WinRT api (c#)? I can check if the device has active mobile data, ethernet or wifi connections, but can't seem to check if any of those connections are currently sending/receiving data.

هل كانت مفيدة؟

المحلول

You could use http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.connectivity.datausage.aspx and check the bytesReceived property. If it changed, data was just transfered. See the linked Quickstart for more information on how to use this.

Other than that, I don't think there's a specialized API for that.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top