Re: Performing Ping from within VB.Net
From: Ralph (nt_consulting32_at_hotmail.com)
Date: 05/12/04
- Next message: Bob Butler: "Re: how do I call a _click() procedure of a button from outside the button itself"
- Previous message: Demian: "Re: Very Strange VB code operation"
- In reply to: Paul Clement: "Re: Performing Ping from within VB.Net"
- Next in thread: Jeff Johnson [MVP: VB]: "Re: Performing Ping from within VB.Net"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 May 2004 18:05:21 -0500
"Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
news:ud12a05gcvo13o7hhlbq5qb4p1k20samo4@4ax.com...
> On Tue, 11 May 2004 18:44:56 +0100, "Raf" <Nomail@noserver.no> wrote:
>
> ¤ Hello to the pros,
> ¤
> ¤ I have to create an application that performs a "Ping" to an IP-address.
The
> ¤ result (successfull or not successfull)
> ¤ should be captured by the application and should be shown to the user.
> ¤
> ¤ I know that you can perform dos-commands with the SHELL-command.
> ¤ But is there a possibility to catch the result of this ping-command if I
do
> ¤ it like this.
> ¤
> ¤ Does anyone have some suggestions?
>
> How to ping an IP address by using sockets in Visual Basic .NET
> http://support.microsoft.com/default.aspx?scid=kb;en-us;828993
>
>
> Paul ~~~ pclement@ameritech.net
> Microsoft MVP (Visual Basic)
Raf,
Paul's suggestion is the best road to take.
Just to amplify a bit - 'ping' is not a "dos command", it is actually a
Windows Console Application. (All the 'net' utilities fall into this
category as well) Console applications normally write information out to
their own, ... well, console. You can not capture their output thru normal
redirection. Nor by any other means, well that is, without writing your own
command console or command processor. (Let's just say it is not impossible,
just the next thing to it.
You can easily test if a particular 'command' is writing to std i/o (thus
easily captured) or not (not available) by simply entering the command in a
console and redirecting the output to a file. ( C: ping myserver >
pingfile ) Then open the file and see what's there. Anything sent to stdout
will appear in the file - anything not there has disappeared into the ether.
My advice - do what Paul suggests - use the socket API.
HTH
-ralph
- Next message: Bob Butler: "Re: how do I call a _click() procedure of a button from outside the button itself"
- Previous message: Demian: "Re: Very Strange VB code operation"
- In reply to: Paul Clement: "Re: Performing Ping from within VB.Net"
- Next in thread: Jeff Johnson [MVP: VB]: "Re: Performing Ping from within VB.Net"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|