How do I detect if my WPF client application is offline?
source link: https://www.codesd.com/item/how-do-i-detect-if-my-wpf-client-application-is-offline.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How do I detect if my WPF client application is offline?
In WPF (in code behind) is there a way to detect whether the computer that the client application is running on has access to the internet?
I'm not sure if there is a simple dedicated method / property to check this or whether I would have to try an HttpGet or similar to determine this.
Is there a property or method for this purpose?
-- Lee
It depends on what you consider "access to the internet"
Safest is to add a 'ping' service to the server you wish to connect to and poll that service.
Trying to keep track of the network status is much harder because it is hard to find out whether it is an intranet other type of network.
See this post too
Related Articles
How does a WPF client application authenticate with a WCF service on Azure?
How to run a method periodically from the WPF client application by using the thread or timer
How do I return control to the client application and re-request my API entry?
How can I detect incoming / outgoing checks by application, without access to the control form?
How to pass DataGridCellEditEventArgs in the WPF MVVM application
How can I detect the execution of specific applications?
WIX: How do I detect if a third-party application is installed?
How do I detect if the salesforce lightforce application runs on a mobile browser or desktop browser?
How to create an SMB iPhone / iPad client application
The appropriate method to perform dependency injection in a Windows client application (WPF)
How to call the REST / JSON WCF service from the client application
How do you use oAuth from a Windows client application?
WPF Client for the Class Library: How to Report an Error to the UI?
BlazeDS StreamingAMF: How to detect when the Flex client closes the connection?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK