0

Hello in the ping app i am using this code

try
            Dim ping As New System.Net.NetworkInformation.Ping
            Return ping.Send(hostNameOrAddress,5000,300).RoundtripTime
        Catch ex As Exception
            MsgBox("Computer Ping Could Not Be Called")
        End Try

but my app will not accept 300 as a amount of bytes,

Help!

2
Contributors
2
Replies
5
Views
8 Years
Discussion Span
Last Post by scrypt3r
0

You're not sending 300 bytes, you're trying to send integer "300"

Try
  Dim ping As New System.Net.NetworkInformation.Ping
  Dim Buffer(299) As Byte ' A buffer for 300 bytes
  ' Fill Buffer()
  Return ping.Send(hostNameOrAddress, 5000, Buffer).RoundtripTime
Catch ex As Exception
  MsgBox("Computer Ping Could Not Be Called")
End Try
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.