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
Administrator
Tech Writer
2.2k
1.5m
Testing Network Connection in C#
Feb 26 2003 10:45 AM
Hey, I am trying to make some code to test wheter or not a my computer is connected to a network - this is what I have but it does not work - it always returns true - ie "Connection is alive". // timer initialization System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = 3000; // test in an interval of 3 sec timer.Tick += new System.EventHandler(this.TestForNetwork); timer.Start(); // Timer Tick event protected void TestForNetwork(object sender, System.EventArgs e) { this.listBox1.Items.Add(System.Windows.Forms.SystemInformation.Network ? "Connection is alive" : "Connection lost"); } The computer is connected on an ethernet network not a diap-up connection - does anybody have any idea what I am doing wrong and what I could be doing right!?!? Thanks! John.
Reply
Answers (
1
)
Error: Input string was not in a correct format
Decimal to Binary