Error with Ping.  
Author Message
WayneSpangler





PostPosted: Visual Basic Express Edition, Error with Ping. Top

Hey guys & gals,

Here is my code:

Try

My.Computer.Network.Ping(" http://www.hide-link.com/ ", 5)

Catch ex As Exception

Timer1.Enabled = False

MessageBox.Show(ex.ToString)

Stop

End Try

Here is my error:

System.Net.NetworkInformation.PingException: An exception occurred during a Ping request. ---> System.Net.Sockets.SocketException: No such host is known

at System.Net.Dns.GetAddrInfo(String name)

at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)

at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)

at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)

--- End of inner exception stack trace ---

at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)

at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer)

at Microsoft.VisualBasic.Devices.Network.Ping(String hostNameOrAddress, Int32 timeout)

at Microsoft.VisualBasic.Devices.Network.Ping(String hostNameOrAddress)

at Pinging.Form1.Timer1_Tick(Object sender, EventArgs e) in C:\VB 2005 - Working\Other\Pinging\Form1.vb:line 5

Unless Microsoft has closed their doors this url has always been there ( No such host is known ).

I appreciate any help. Thanks in advance.




Visual Studio Express Editions41  
 
 
Dave299





PostPosted: Visual Basic Express Edition, Error with Ping. Top

Take out the http:// and you will get rid of the error message.

It still doesn't work because they seem to have the server set not to return pings but other sites (e.g. www.google.com) are ok.

Also the timeout should be in milliseconds. 5 msecs doesn't give long for a server to respond.


 
 
WayneSpangler





PostPosted: Visual Basic Express Edition, Error with Ping. Top

Thanks,

I had tried pinging my site but got the error so I used Microsoft because I knew it was there.

I somehow elimited some zero's in my delay.

I removed the "http://" and everything works great.

Thanks again,