
Introduction
Add a Ping control to your form and set the following properties:
- The IP-address to ping.
- The terminal type (Server, Router, Desktop, �.).
- The e-mail address of the person who will be notified when
the remote host does not respond.
- The short description of the remote host.
- The ping interval.
- Write a log file - Yes or No. The log file can be viewed and printed.
Controls can be added to build a visual representation of your network.
When a remote host does not respond, the image will change, a warning message
will be displayed and a log will be generated with the date and time. The e-mail
recipient will also be notified.
| You must Sign In to use this message board. |
|
| | Msgs 1 to 10 of 10 (Total in Forum: 10) (Refresh) | FirstPrevNext |
|
 |
|
|
 |
|
|
 |
|
 |
Hi,
I've created a multithreaded app, and used part of your ping control, but Im having a problem with it. Essentially each thread is seeing a succsessfull repsonse from another threads IP address, even when its own ip address should not get a response.
i.e Thread 0 pings 10.0.0.1 (should get no response) Thread 1 pings 10.0.0.2 (should get a respone)
Both threads return a succsessfull ping. If i dont multithread (so one ping at a time) then it works ok.
Any ideas?
P.S. - What form of licencing is your code restricted to? or is completly open source?
Thanks
Jeff.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi
I never did find a solution as such, but I did write some code which (in my opinion anyway) worked better.
This is the code:
Public Function PingIPAddress(ByVal Destination As String) As Boolean Dim PingInfo As New System.Diagnostics.ProcessStartInfo("ping") PingInfo.WindowStyle = ProcessWindowStyle.Hidden 'You can change the attempts at a ping by changing the " -n 1" part to a higher number - e.g. " -n 3" 'also possible to add other options here such as "-l 64" ( send 64 bytes of data) PingInfo.Arguments = Destination & " -n 1" PingInfo.CreateNoWindow = True PingInfo.UseShellExecute = False PingInfo.RedirectStandardOutput = True Dim SystemProcess As New System.Diagnostics.Process SystemProcess.StartInfo = PingInfo SystemProcess.Start() SystemProcess.WaitForExit() Dim tmpResult As String tmpResult = SystemProcess.StandardOutput.ReadToEnd If InStr(tmpResult, "Reply from") > 0 Then 'Debug.WriteLine("*******************************************") 'Debug.Write(tmpResult) 'Debug.WriteLine("*******************************************") Return True Else 'Debug.WriteLine("*******************************************") 'Debug.Write(tmpResult) 'Debug.WriteLine("*******************************************") Return False End If End Function
Essentially it calls the DOS ping command and returns the results. It then simply checks for the "Reply from" text (or lack of). I'm sure it will give you the basis for retrieving more info if required.
Hope it helps 
Jeff.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
This is a problem that I have run into with a lot of code samples, they accept all pings without checking the ID. To fix this problem you need to set the identifier to some random number and then check to make sure that you recived the correct Identifier.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
This is a nice sample, but I am having the same problem I have with all the "ping" samples I find on the web: the first ping comes back just fine, but subsequent pings return '0' as if they didn't work at all, until I restart the application. I have seen other people post this similar problem on another ping sample, but no one had answered them.
I am running winxp pro sp2 with .net framework 1.1 and vs.net 2003(winxp firewall turned OFF)
Thanks, Elijah
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
 |
Hi Elijah,
I tested it here on my network and found that it workings fine.
The '0' that you are referring to, I think, is the response time in milliseconds. If you run the code in debug mode, you will see that 'Ping' function is executed every time.
I would really like to help you, but I need more information on your actual problem. Thank you for your interest Hendrik
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
General
News
Question
Answer
Joke
Rant
Admin