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!

Ping Program

Status
Not open for further replies.

ScarEye

MIS
Oct 22, 2003
33
US
Hey guys, I downloaded a free ping utility that works with C#. Now I was wondering if I add multiple text boxes with ip's and when I click on the ping button I would like it to cycle through all the text boxes and give me my results. If anyone can take a look at it and help me out that would be great. You can download the program from the site below





Thanks In Advance
ScarEye



Hopefully this thread will help others..
 
Assuming the program you downloaded has a single entry point (I haven't checked), you can do this by simply saying:
Code:
If (checkbox1.Checked)
{
  // Call ping
  // bool isAlive = TheirPing(textbox1.Text);
  label1.Text = isAlive ? "Alive" : "Dead to the world";
}

If (checkbox2.Checked)
{
  // Call ping
  // bool isAlive = TheirPing(textbox2.Text);
  label2.Text = isAlive ? "Alive" : "Dead to the world";
}

//etc.
Obviously, this code can be cleaned up some, but should be enough to get you started.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top