how do i make the source (127.0.0.1) different. I want to test a ping from a changing source and destination.
Bob Learned
You don't have control over the source. You would have to run the test from that machine.
The Ping class is a wrapper around the IcmpSendEcho2 command:
<DllImport("iphlpapi.dll", SetLastError:=True)> _
Friend Shared Function IcmpSendEcho2(ByVal icmpHandle As SafeCloseIcmpHandle, ByVal [Event] As SafeWaitHandle, ByVal apcRoutine As IntPtr, ByVal apcContext As IntPtr, ByVal ipAddress As UInt32, <[In]> ByVal data As SafeLocalFree, ByVal dataSize As UInt16, ByRef options As IPOptions, ByVal replyBuffer As SafeLocalFree, ByVal replySize As UInt32, ByVal timeout As UInt32) As UInt32
End Function
That function only specifies destination addresses, and not source addresses.
what can i do to change the source. is that a add-on for vb that will give me that flexibility?
there are utilities that you can set source and destination. This is what my goal is.
Thanks
Bob Learned
I believe that the difficulty is at the operating system level. The assumption is that the source is already known, so it is not an argument. There are no add-ons, or arguments that you can specify with IcmpSendEcho2 that will allow you to do that, that I know of.
http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx