Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Router 1
- PingReply pingresult1 = ping.Send(textBoxRouter1.Text, timeout, buffer, options);
- if (pingresult1.Status.ToString() == "Success")
- {
- pictureBoxRouter1.Image = Properties.Resources.router_online;
- toolTip0.SetToolTip(pictureBoxRouter1, "Ethernet: " + textBoxRouter1.Text + " | UP" + Environment.NewLine + "Serial 0: " + "192.168." + textBoxSerialAB.Text + ".2" + " | UP" + Environment.NewLine + "Ethernet: " + textBoxRouter1.Text + " | UP" + Environment.NewLine + "Serial 1: " + "192.168." + textBoxSerialBC.Text + ".1" + " | UP");
- richTextBoxOutput.Text += "-------------------------------------------";
- richTextBoxOutput.Text += Environment.NewLine + "ROUTER - B";
- richTextBoxOutput.Text += Environment.NewLine;
- richTextBoxOutput.Text += Environment.NewLine + "Ethernet: " + pingresult1.Address.ToString();
- richTextBoxOutput.Text += Environment.NewLine + "Serial 0: " + "192.168." + textBoxSerialAB.Text + ".2";
- richTextBoxOutput.Text += Environment.NewLine + "Serial 1: " + "192.168." + textBoxSerialBC.Text + ".1";
- richTextBoxOutput.Text += Environment.NewLine;
- richTextBoxOutput.Text += Environment.NewLine + "Response time: " + pingresult1.RoundtripTime + "ms";
- richTextBoxOutput.Text += Environment.NewLine + "Time to live: " + pingresult1.Options.Ttl;
- richTextBoxOutput.Text += Environment.NewLine + "Don't fragment: " + pingresult1.Options.DontFragment;
- richTextBoxOutput.Text += Environment.NewLine + "Buffer size: " + pingresult1.Buffer.Length;
- richTextBoxOutput.Text += Environment.NewLine + "-------------------------------------------";
- }
- else
- {
- pictureBoxRouter1.Image = Properties.Resources.router_offline;
- toolTip0.SetToolTip(pictureBoxRouter1, "Ethernet: " + textBoxRouter1.Text + " | DOWN");
- PingReply pingresultS1 = ping.Send("192.168." + textBoxSerialAB.Text + ".2");
- if (pingresultS1.Status.ToString() == "Success")
- {
- toolTip0.SetToolTip(pictureBoxRouter1, "Ethernet: " + textBoxRouter1.Text + " | DOWN" + Environment.NewLine + "Serial 0: " + "192.168." + textBoxSerialAB.Text + ".2" + " | UP");
- }
- else
- {
- toolTip0.SetToolTip(pictureBoxRouter1, "Ethernet: " + textBoxRouter1.Text + " | DOWN" + Environment.NewLine + "Serial 0: " + "192.168." + textBoxSerialAB.Text + ".2" + " | DOWN");
- }
- PingReply pingresultS11 = ping.Send("192.168." + textBoxSerialBC.Text + ".1");
- if (pingresultS11.Status.ToString() == "Success")
- {
- toolTip0.SetToolTip(pictureBoxRouter1, "Ethernet: " + textBoxRouter1.Text + " | DOWN" + Environment.NewLine + "Serial 0: " + "192.168." + textBoxSerialAB.Text + ".2" + " | UP" + Environment.NewLine + "Serial 1: " + "192.168." + textBoxSerialBC.Text + ".1" + " | UP");
- }
- else
- {
- toolTip0.SetToolTip(pictureBoxRouter1, "Ethernet: " + textBoxRouter1.Text + " | DOWN" + Environment.NewLine + "Serial 0: " + "192.168." + textBoxSerialAB.Text + ".2" + " | DOWN" + Environment.NewLine + "Serial 1: " + "192.168." + textBoxSerialBC.Text + ".1" + " | DOWN");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment