TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to Check Internet Connection using C#
Neeraj Kumar
Mar 24
2015
Code
1.9
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
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