Solved

Ping, Then Update Label and Image

Posted on 2011-02-22
1
255 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now