Solved

Ping, Then Update Label and Image

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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 …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 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