Can we detect the internet connection?
Means is it on or off?
Internet connection
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
Tanmay SarkarRank #1,407 · 1.2K reputationPosted Jul 9, 2010, 9:37 AM EDT
using System.Net.NetworkInformation;
void Button1Click(object sender, EventArgs e)
{
bool mynetcon = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();
label1.Text= Convert.ToString(mynetcon);
}
If you have any other code please put here.
Thank you.