?
Solved

Ping, Then Update Label and Image

Posted on 2011-02-22
1
Medium Priority
?
273 Views
Last Modified: 2012-05-11
Hello everyone,

I'm new here and I'm wondering if someone might be able to help walk me through my problem.

I have a Windows form with a label. I want to ping a specific IP address in the network. If a response is received, I want to display some text in a label such as "Status: Connected" and if there is no reply, display "Status: Disconnected". Also, if there is a reply from the device at that IP, show image1 on the form and if there is no reply, show image2.

Thanks!
0
Comment
Question by:StillNew2VB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
StillNew2VB earned 0 total points
ID: 34958514
I got this figured out....

    Private Sub tmrVPN_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrVPN.Tick
        Try
            If My.Computer.Network.Ping("192.168.0.1", 2000) = True Then
                pbVPN.Image = My.Resources.VPNOn
            Else : pbVPN.Image = My.Resources.VPNOff
            End If
        Catch ex As Exception

        End Try
    End Sub

Open in new window

0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question