Status Bar help needed
I need to show Internet Connection Status in Windows for Status bar.. wat can i do?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
jingePosted Oct 28, 2009, 4:01 AM
First we need a way to get if your computer has connection with the INTERNET, and then update the statusBar.
To make sure if the computer is connected, we have many ways. Ping the remote machine or other means.
For example:
bool ConnectionExists()
{
try
{
System.Net.Sockets.TcpClient clnt=new System.Net.Sockets.TcpClient("www.google.com",80);
clnt.Close();
return true;
}
catch(System.Exception ex)
{
return false;
}
As for StatusBar, you can add a label to use text describing the status or use an Image.
Let me know if you have anything unclear.