Sign in to follow this  
Followers 0
Bob O

Ping In Vb6

5 posts in this topic

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 by Bob O

Share this post


Link to post
Share on other sites
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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0