Status Bar help needed
I need to show Internet Connection Status in Windows for Status bar.. wat can i do?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
jingeRank #2,527 · 554 reputationPosted Oct 28, 2009, 12:01 AM EDT
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.