Posted 24 Jan 2006 (edited) I believe there are some VB6 programmers in here so I thought I would toss this one out here. I am new to VB and I am working on a form that I would like to include a ping routing that would run in the background and ping the server and my cameras and give an indication of a good or bad connection with colors. I found some code for this but I think it is for .net and does not work in VB6. Dim ping As New cPing Dim IP As String = "192.168.1.50" ' Camera IP address Dim w As Short Dim Data As String If ping.ping(IP, w, Data) = True Then lblGS.BackColor = Color.Green Else lblGS.BackColor = Color.Red End If Any help is appreciated. Bob O. Edit....That looks ugly PingVB6.doc Edited 24 Jan 2006 by Bob O Share this post Link to post Share on other sites
Posted 24 Jan 2006 I just happen to have a sample project that I had found a few months back that I used for a similar application. So here you go, if you have any questions let me know. It is probably a little more than you need, I know I stripped it down considerably for my application. Ping_From_VB.zip Share this post Link to post Share on other sites
Posted 24 Jan 2006 Tech Junki, I found that same one this past weekend but you are correct that it seems to be more then I need and when I found that short bit of code that I post I became fixated on finding something nice and simple if possible. Any chance you could post your stripped down version if not I understand. Thanks, Bob O. Share this post Link to post Share on other sites
Posted 24 Jan 2006 If you were using VB.NET it would be much simpler but unfortunately I think this is the best way I found in VB6. Just add the module in you program then forget it is there. The code to call the module is relatively simple from your main routine. Made a few quick mods to shorten and simplify from the main routine. Ping.zip Share this post Link to post Share on other sites