Solved

Ping, Then Update Label and Image

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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 article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
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…

749 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