Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i use a button that auto pings without entering IP address

Status
Not open for further replies.
Feb 21, 2002
3
SG
I have a project that when i click on it the button will automatically ping the server that i am using on my computer without typing in the IP address. When the server responds, the button will change its colour into green. When it fail to respond, the button will change itself to red. Please help me out as i need to hand this project in 1 week's time
 
Quick & Simple method:

Shell the DOS command PING 192.168.1.1 and write the response back to a text file. The DOS command is...

PING 192.168.1.1 > ping.txt

Look up the 'Shell' function in your VB help.

Next open the ping.txt file that youve just made, read through it and look for the 'Reply From' statement. If you can't find it, then the ping failed. You can make the above a function, which will return true or false for target response and colour your button accordingly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top