KB-15457: Pinging external devices via E3.

Question:

How can I ping a device that is external to the network running the application?

Solution:

To do so, you can use VBScripts commands.

For example:

dim oShell, strComputer
set oShell = CreateObject(“WScript.Shell”)
strComputer = InputBox(“Type the IP address you want to ping:”, “Ping”)

if strComputer <> “” then
   ‘ Ping Command options: timeout = 200 ms; number of echo requests = 1
   if oShell.Run(“ping ” & strComputer & ” -w 200 -n 1″, 0, true) = 0 then
      MsgBox strComputer & ” responded to ping.”, 0, “Ping OK”
   else
      MsgBox strComputer & ” did not respond to ping”, 0, “Ping Fail”
   end if
end if

NOTE: Attached is a sample application developed with E3 version 3.1 Build 270.

Attachments:

AppPing.zip

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Deixe seu Comentário

Seu endereço de e-mail não será publicado. Campos marcados com asterisco são obrigatórios *