Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ping ping = new Ping();
- //Router 0
- PingReply pingresult = ping.Send(textBoxRouter0.Text, timeout, buffer, options);
- if (pingresult.Status.ToString() == "Success")
- {
- pictureBoxRouter0.Image = Properties.Resources.router_online;
- //A > B
- PingReply serialAB1 = ping.Send("192.168." + textBoxSerialAB.Text + ".2", timeout);
- if (serialAB1.Status.ToString() == "Success") { _statusAB1 = " | UP"; } else { _statusAB1 = " | DOWN"; }
- toolTip0.SetToolTip(pictureBoxRouter0, "Ethernet: " + textBoxRouter0.Text + " | UP" + Environment.NewLine + "Serial 0: Not needed" + Environment.NewLine + "Serial 1: " + "192.168." + textBoxSerialAB.Text + ".1" + _statusAB1);
- richTextBoxOutput.Text += "-------------------------------------------";
- richTextBoxOutput.Text += Environment.NewLine + "ROUTER - A";
- richTextBoxOutput.Text += Environment.NewLine;
- richTextBoxOutput.Text += Environment.NewLine + "Ethernet: " + pingresult.Address.ToString();
- richTextBoxOutput.Text += Environment.NewLine + "Serial 0: " + "Not needed";
- richTextBoxOutput.Text += Environment.NewLine + "Serial 1: " + "192.168." + textBoxSerialAB.Text + ".1";
- richTextBoxOutput.Text += Environment.NewLine;
- richTextBoxOutput.Text += Environment.NewLine + "Response time: " + pingresult.RoundtripTime + "ms";
- richTextBoxOutput.Text += Environment.NewLine + "-------------------------------------------";
- }
- else
- {
- pictureBoxRouter0.Image = Properties.Resources.router_offline;
- //A > B
- PingReply serialAB1 = ping.Send("192.168." + textBoxSerialAB.Text + ".2", timeout);
- if (serialAB1.Status.ToString() == "Success") { _statusAB1 = " | UP"; } else { _statusAB1 = " | DOWN"; }
- toolTip0.SetToolTip(pictureBoxRouter0, "Ethernet: " + textBoxRouter0.Text + " | DOWN" + Environment.NewLine + "Serial 0: " + "Not needed" + Environment.NewLine + "Serial 1: " + "192.168." + textBoxSerialAB.Text + ".1" + _statusAB1);
- }
Advertisement
Add Comment
Please, Sign In to add comment