Solved

Ping, Then Update Label and Image

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

691 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