Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have develop a windows application that will send/receive data from internet.
now its done and also working perfectly..

but my question is that when i trying to send or receive the data at that time i want to check whether the client is connected to internet or not.. as per this result i want to show a message to client that connect to internet if he/she not connected to internet.
Posted
Updated 21-Sep-11 3:00am
v2
Comments
Marc A. Brown 21-Sep-11 9:01am    
What have you tried? What's the problem?

If you google for "check internet connection status C#" you'll get a whole bunch of examples doing this with different methods. Here's a short list:


  1. http://www.dreamincode.net/code/snippet1568.htm[^]
  2. http://www.c-sharpcorner.com/UploadFile/scottlysle/ConnectionState02092007002552AM/ConnectionState.aspx[^]


There are more which you find with the above mentioned search terms.

Best regards,

—MRB
 
Share this answer
 
You can try this:

C#
bool networkUp = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable(); 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900