Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to Check Internet Connection using C#
WhatsApp
Neeraj Kumar
Mar 24
2015
2.2
k
0
0
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
using
System.Net.NetworkInformation;
namespace
internet
{
public
partial
class
internet : Form
{
public
bool
check_connection;
public
internet()
{
InitializeComponent();
}
private
void
internet_Load(
object
sender, EventArgs e)
{
check_connection = NetworkInterface.GetIsNetworkAvailable();
if
(check_connection)
{
this
.pictureBox1.Image = global::internet.Properties.Resources._4;
label1.Text =
"Connected"
;
}
}
}
}
C# Programming
Checking Internet Connection
Up Next
How to Check Internet Connection using C#