|
-
Nov 19th, 2010, 07:58 AM
#1
Thread Starter
Hyperactive Member
need help with ping program
hi,
i need to replicate the ping in command prompt. i'm currently using the following:
Code:
Try
If My.Computer.Network.Ping(mtbIPAddress.Text) Then
rtbLog.AppendText("Response")
Else
rtbLog.AppendText("Reject")
End If
Catch ex As Exception
rtbLog.AppendText("Reject")
End Try
but i need to get the same response as the ping in command prompt ie..
Code:
Pinging www.l.google.com [74.125.71.104] with 32 bytes of data:
Reply from 74.125.71.104: bytes=32 time=240ms TTL=53
Reply from 74.125.71.104: bytes=32 time=313ms TTL=53
Reply from 74.125.71.104: bytes=32 time=256ms TTL=53
Request timed out.
Reply from 74.125.71.104: bytes=32 time=251ms TTL=53
how do i get the bytes, time and TTL?
thanks
VB Version: Microsoft Visual Studio 2008 Professional Edition
.NET Version: Microsoft .NET Framework Version 3.5
OS: Windows XP SP3
-
Nov 19th, 2010, 09:15 AM
#2
Re: need help with ping program
Try the following code
Code:
Imports System.Net.NetworkInformation
=================================
Dim Ping As New Ping
Dim PingOptions As New PingOptions
PingOptions.Ttl = 64
Dim PingReply As PingReply = Ping.Send("192.168.1.1", 500)
If PingReply.Status = IPStatus.Success Then
MsgBox(PingReply.Options.Ttl)
MsgBox(PingReply.Buffer.Length)
End If
-
Nov 19th, 2010, 06:23 PM
#3
Thread Starter
Hyperactive Member
Re: need help with ping program
thanks.
just an additional question. i noticed that when i pinged www.google.com it showed me a notification pinging www.l.google.com? where did the www.l.google.com come from?
VB Version: Microsoft Visual Studio 2008 Professional Edition
.NET Version: Microsoft .NET Framework Version 3.5
OS: Windows XP SP3
-
Nov 19th, 2010, 06:26 PM
#4
Frenzied Member
Re: need help with ping program
-
Nov 20th, 2010, 02:36 AM
#5
Re: need help with ping program
-
Nov 20th, 2010, 06:48 AM
#6
Re: need help with ping program
 Originally Posted by adshocker
Why are you pinging Google? (dewayne asks, warming up the soapbox) See my signature.
-
Nov 20th, 2010, 06:19 PM
#7
Thread Starter
Hyperactive Member
Re: need help with ping program
i was just curious because if in case the user will enter a domain instead of an ip address, which domain should i get the ip address from. getting the ip address is another issue though.
VB Version: Microsoft Visual Studio 2008 Professional Edition
.NET Version: Microsoft .NET Framework Version 3.5
OS: Windows XP SP3
-
Nov 21st, 2010, 06:29 AM
#8
Re: need help with ping program
What does what you said have to do with pinging Google? DNS is responsible for getting IP addresses associated with names and names associated with IP addresses.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|