Connecting Tech Pros Worldwide Help | Site Map

Ping without using raw sockets

Rudolf
Guest
 
Posts: n/a
#1: Nov 20 '05
Is there a way in VB.Net to implement ping functionality
without using raw sockets?
I cannot use raw sockets because it has been
locked/disabled for security reasons.

Thanks

Rudolf

Guest
 
Posts: n/a
#2: Nov 20 '05

re: Ping without using raw sockets


Just as an update for more info. When creating a socket of
Icmp type for ping the SocketType is set to raw in the
sample I have. However setting it to something else cause
the socket creation to fail.

e.g.
ICMPSocket = New Socket(AddressFamily.InterNetwork,
SocketType.Raw, ProtocolType.Icmp)

Rudolf
[color=blue]
>-----Original Message-----
>Is there a way in VB.Net to implement ping functionality
>without using raw sockets?
>I cannot use raw sockets because it has been
>locked/disabled for security reasons.
>
>Thanks
>
>Rudolf
>
>.
>[/color]
Tom Shelton
Guest
 
Posts: n/a
#3: Nov 20 '05

re: Ping without using raw sockets


On 2003-11-05, Rudolf <rudolfh@hotmail.com.donotspammeandsoon> wrote:[color=blue]
> Is there a way in VB.Net to implement ping functionality
> without using raw sockets?
> I cannot use raw sockets because it has been
> locked/disabled for security reasons.
>
> Thanks
>
> Rudolf
>[/color]

Well, there are a couple of ways that come to mind. You could use the
System.Diagnostics.Process class to call the windows ping program in the
back ground and redirect it's output so that you can read and parse the
results...

Another method maybe to use P/Invoke to call the Icmp helper functions
to perform the ping. I used to have a VB.NET sample of this that I put
together from some VB6 code I found, but for the life of me - I can't
find it. It maybe at work, so I will check tomorrow and post back...

--
Tom Shelton
MVP [Visual Basic]
Rudolf
Guest
 
Posts: n/a
#4: Nov 20 '05

re: Ping without using raw sockets


Thanks, If you can it would be appreciated.

Rudolf
[color=blue]
>-----Original Message-----
>On 2003-11-05, Rudolf[/color]
<rudolfh@hotmail.com.donotspammeandsoon> wrote:[color=blue][color=green]
>> Is there a way in VB.Net to implement ping[/color][/color]
functionality[color=blue][color=green]
>> without using raw sockets?
>> I cannot use raw sockets because it has been
>> locked/disabled for security reasons.
>>
>> Thanks
>>
>> Rudolf
>>[/color]
>
>Well, there are a couple of ways that come to mind. You[/color]
could use the[color=blue]
>System.Diagnostics.Process class to call the windows ping[/color]
program in the[color=blue]
>back ground and redirect it's output so that you can read[/color]
and parse the[color=blue]
>results...
>
>Another method maybe to use P/Invoke to call the Icmp[/color]
helper functions[color=blue]
>to perform the ping. I used to have a VB.NET sample of[/color]
this that I put[color=blue]
>together from some VB6 code I found, but for the life of[/color]
me - I can't[color=blue]
>find it. It maybe at work, so I will check tomorrow and[/color]
post back...[color=blue]
>
>--
>Tom Shelton
>MVP [Visual Basic]
>.
>[/color]
Closed Thread