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
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tristen Shaw
NA
13
20.4k
Whats wrong with my code?
Aug 29 2012 6:31 PM
I'm trying to make a label change text and color based on whether my application can detect an active internet connection.
private void lblConnection_Click(object sender, EventArgs e)
{
bool ConnCheck = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();
if (ConnCheck == true)
{
lblConnection.Text = "Available";
lblConnection.ForeColor = Color.LimeGreen;
}
else
{
lblConnection.Text = "Unavailable";
lblConnection.ForeColor = Color.Red;
}//End Conncheck if statement//
}//End lblConnection Class//
I would also like to make the application watch this connection dynamically and update the label as things change.
Reply
Answers (
3
)
BinarySearch()
how do i reflect datas from UI to excel in VC#