9

How do I detect if my WPF client application is offline?

 3 years ago
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.
neoserver,ios ssh client

How do I detect if my WPF client application is offline?

advertisements

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

Tags wpf

Related Articles

How does a WPF client application authenticate with a WCF service on Azure?

I'm currently considering creating an application to deploy to the azure cloud. The main reason for considering Azure over Amazon is the access control service. I want to accept as many different credential types as possible for my application, espec

How to run a method periodically from the WPF client application by using the thread or timer

I am developing a WPF client application.This app sends data periodically to the webservice. When user logged into the app I want run particular method every 5 mts to send data to the .asmx service. My question is whether I need to use threading or t

How do I return control to the client application and re-request my API entry?

Writing a pure API seems to be bring up some challenges. For example, I am used to writing winforms/asp.net apps where if the input I have is invalid, I can programatically bring up a dialog box/webpage. However, an API has no knowledge of the GUI ap

How can I detect incoming / outgoing checks by application, without access to the control form?

I can use the Control.Enter and Control.Leave events to detect when user focus enters or leaves a control, but this only works on a per-form basis. I use more than one form in my application, and want to track which control has user focus, I have to

How to pass DataGridCellEditEventArgs in the WPF MVVM application

I am working on WPF LOB application and Using Prism and delegate commands to separate UI from View Model. When ever user make a change on a particular cell FROM UI (not from View Model or Service), I need to invoke some other functionality. I have cr

How can I detect the execution of specific applications?

i want to detect gallery applications running using service so i found ActivityManager but it returned only running service own application here is my java code ActivityManager actMng = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); Str

WIX: How do I detect if a third-party application is installed?

Is it any way in WIX to detect that a third-party application with a specified upgrade code is installed and what is it's installation folder? I can suggest a custom action is required, but what exactly to do in such custom action? Is it possible to

How do I detect if the salesforce lightforce application runs on a mobile browser or desktop browser?

We have salesforce lightning app which runs on both mobile and desktop. Need to write some code only for mobile application. How to detect whether app is running on a mobile browser or desktop browser? I used following code but its not working: check

How to create an SMB iPhone / iPad client application

I can smell a smoke from my head a little bit. I'm trying to create an iPhone/iPad application which can find computers in the network and then browse their shared directories and for example read some documents, play videos and so on. It would be gr

The appropriate method to perform dependency injection in a Windows client application (WPF)

I am used to IoC/DI in web applications - mainly Ninject with MVC3. My controller is created for me, filled in with all dependencies in place, subdependencies etc. However, things are different in a thick client application. I have to create my own o

How to call the REST / JSON WCF service from the client application

I have WCF REST/JSON Service, I create it by using this template. In my service I have a method [WebInvoke(UriTemplate = "Create", Method = "*",RequestFormat = WebMessageFormat.Json,BodyStyle = WebMessageBodyStyle.Bare)] public void Cr

How do you use oAuth from a Windows client application?

I am looking at integrating a public api in to an existing windows form application. The api requires openAuth authentication. All examples of this that I have seen are on web based applications. How can openAUth be used on a client application? than

WPF Client for the Class Library: How to Report an Error to the UI?

I'm new to WPF and I'm working on a project that will have the following components : a WCF server class library, a WCF client class library, a WPF client UI and a WPF server UI. I have a method in WCF client that add a user to a collection in the cl

BlazeDS StreamingAMF: How to detect when the Flex client closes the connection?

I have a Flex application that connects to a BlazeDS server using the StreamingAMF channel. On the server-side the logic is handled by a custom adapter that extends ActionScriptAdapter and implements FlexSessionListener and FlexClientListener interfa

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK