Search:
Namespaces
Discussions
.NET v1.1
Feedback
Ping in VB.NET?
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngvb' list
.
Al B -DN
Al Bsharah
Network Insight
http://www.networkinsight.com
<
http://www.networkinsight.com
/>
Click here to reveal e-mail address
858.450.1180 (main)
858.362.8383 (direct)
619.843.2565 (cell)
858.450.1141 (fax)
Reply to this message...
Patrick Steele
Here's some C# code. Should be fairly easy to translate:
http://www.c-sharpcorner.com/network/ping.asp
---
Patrick Steele (
Click here to reveal e-mail address
)
Lead Software Architect
Image Process Design
-----Original Message-----
From: Al B -DN [mailto:
Click here to reveal e-mail address
]=20
Sent: Wednesday, May 29, 2002 4:09 AM
To: aspngvb
Subject: [aspngvb] Ping in VB.NET?
=20
=20
Al Bsharah
Network Insight
http://www.networkinsight.com
<
http://www.networkinsight.com
/>=20
Click here to reveal e-mail address
858.450.1180 (main)
858.362.8383 (direct)
619.843.2565 (cell)
858.450.1141 (fax)
=20
| [aspngvb] member
Click here to reveal e-mail address
=3D YOUR ID
|
http://www.asplists.com/asplists/aspngvb.asp
=3D JOIN/QUIT
Reply to this message...
Al B -DN
Huh. Sorry about the blank message. I most definitely typed something,
but apparently lost it somehow...anyway:
I've been unsuccessful in my hunts for a way to simply ping an IP using
VB.NET, and to identify whether or not it was a success or failure.
I'll need to do this multiple times, and track responses for each ping
(setting a specified timeout as well). Any insight?
Thanks!
Al
-ALB-
-----Original Message-----
From: Al B -DN [mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, May 29, 2002 1:09 AM
To: aspngvb
Subject: [aspngvb] Ping in VB.NET?
| [aspngvb] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/asplists/aspngvb.asp
= JOIN/QUIT
Reply to this message...
Byxbee, Race
Hey,
Try this...
Dim tcpClient As New
TcpClient
()
Dim myIP As
IPAddress
=
IPAddress
.Parse("192.168.1.2")
Try
'You can change the 11003 to whatever port you wish to hit (i.e.
8080)
tcpClient.Connect(myIP, 11003)
Catch e As Exception
'Do what you want in here if the ping is unsuccessful
End Try
Race
-----Original Message-----
From: Al B -DN [mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, May 29, 2002 11:17 AM
To: aspngvb
Subject: [aspngvb] RE: Ping in VB.NET?
Huh. Sorry about the blank message. I most definitely typed something,
but apparently lost it somehow...anyway:
I've been unsuccessful in my hunts for a way to simply ping an IP using
VB.NET, and to identify whether or not it was a success or failure.
I'll need to do this multiple times, and track responses for each ping
(setting a specified timeout as well). Any insight?
Thanks!
Al
-ALB-
-----Original Message-----
From: Al B -DN [mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, May 29, 2002 1:09 AM
To: aspngvb
Subject: [aspngvb] Ping in VB.NET?
| [aspngvb] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/asplists/aspngvb.asp
= JOIN/QUIT
| [aspngvb] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/asplists/aspngvb.asp
= JOIN/QUIT
Reply to this message...
Dunne, Joe
Race, your code is not pinging although it does verify the other end exists.
To ping a computer you do not use port numbers or need to logon which are
Router/gateway filtered and thus would effect your code. Just wanted to
point this out FYI.
To answer the original question
There is a sample via Visual Studio Magazine.
http://www.fawcette.com/vsm/2002
_03/magazine/columns/qa/page2.asp
<
http://www.fawcette.com/vsm/2002
_03/magazine/columns/qa/page2.asp>
HTH
joe
-----Original Message-----
From: Byxbee, Race [mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, May 29, 2002 11:45 AM
To: aspngvb
Subject: [aspngvb] RE: Ping in VB.NET?
Hey,
Try this...
Dim tcpClient As New
TcpClient
()
Dim myIP As
IPAddress
=
IPAddress
.Parse("192.168.1.2")
Try
'You can change the 11003 to whatever port you wish to hit (i.e.
8080)
tcpClient.Connect(myIP, 11003)
Catch e As Exception
'Do what you want in here if the ping is unsuccessful
End Try
Race
-----Original Message-----
From: Al B -DN [ mailto:
Click here to reveal e-mail address
<mailto:
Click here to reveal e-mail address
> ]
Sent: Wednesday, May 29, 2002 11:17 AM
To: aspngvb
Subject: [aspngvb] RE: Ping in VB.NET?
Huh. Sorry about the blank message. I most definitely typed something,
but apparently lost it somehow...anyway:
I've been unsuccessful in my hunts for a way to simply ping an IP using
VB.NET, and to identify whether or not it was a success or failure.
I'll need to do this multiple times, and track responses for each ping
(setting a specified timeout as well). Any insight?
Thanks!
Al
-ALB-
-----Original Message-----
From: Al B -DN [ mailto:
Click here to reveal e-mail address
<mailto:
Click here to reveal e-mail address
> ]
Sent: Wednesday, May 29, 2002 1:09 AM
To: aspngvb
Subject: [aspngvb] Ping in VB.NET?
| [aspngvb] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/asplists/aspngvb.asp
<
http://www.asplists.com/asplists/aspngvb.asp
> = JOIN/QUIT
| [aspngvb] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/asplists/aspngvb.asp
<
http://www.asplists.com/asplists/aspngvb.asp
> = JOIN/QUIT
| [aspngvb] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/aspngvb.asp
= JOIN/QUIT
Reply to this message...
System.Net.IPAddress
System.Net.Sockets.TcpClient
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com