Làm thế nào tôi có thể phát hiện kết nối mạng trong Windows Phone 7? Có một API đơn giản cho điều đó không?Làm cách nào để phát hiện kết nối mạng trong Windows Phone 7?
Trả lời
Tôi đã tìm thấy :-P
System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable(
);
Cảm ơn các bạn đã chỉ cho tôi đúng hướng.
Nó luôn luôn trở lại sự thật, tại sao vậy? – onmyway133
Hãy thử NetworkChange.NetworkAddressChange sự kiện trong System.Net.NetworkInformation namesapce.
Thanh toán this blog để biết chi tiết triển khai.
Nó có sẵn trong lớp System.Net.NetworkInformation.NetworkInterface theo quy định liên kết dưới đây http://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.aspx
http://msdn.microsoft.com/en-us/library/microsoft.phone.net.networkinformation(v=vs.92).aspx – Rama
Xem xét sử dụng NetworkInformation.DeviceNetworkInformation.IsNetworkAvailable
trong Microsoft.Phone.Net namespace
trùng lặp có thể xảy ra [Có một nhanh chóng dễ dàng hơn cách để phát hiện xem thiết bị (Windows Phone 7) có kết nối internet hay không] (http://stackoverflow.com/questions/3680374/is-there-an-easier-fast-way-to-detect-whether-the-windows -phone-7-device-has- an) – ctacke
Tại sao lại là downvote? Đó là một câu hỏi hay, hợp lý - chỉ là một trò lừa đảo. – ctacke