jonassvensson4

Untitled

Apr 16th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.03 KB | None | 0 0
  1. //Router  1
  2. PingReply pingresult1 = ping.Send(textBoxRouter1.Text, timeout, buffer, options);
  3. if (pingresult1.Status.ToString() == "Success")
  4. {
  5.     pictureBoxRouter1.Image = Properties.Resources.router_online;
  6.     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");
  7.  
  8.     richTextBoxOutput.Text += "-------------------------------------------";
  9.     richTextBoxOutput.Text += Environment.NewLine + "ROUTER - B";
  10.     richTextBoxOutput.Text += Environment.NewLine;
  11.     richTextBoxOutput.Text += Environment.NewLine + "Ethernet: " + pingresult1.Address.ToString();
  12.     richTextBoxOutput.Text += Environment.NewLine + "Serial 0: " + "192.168." + textBoxSerialAB.Text + ".2";
  13.     richTextBoxOutput.Text += Environment.NewLine + "Serial 1: " + "192.168." + textBoxSerialBC.Text + ".1";
  14.     richTextBoxOutput.Text += Environment.NewLine;
  15.     richTextBoxOutput.Text += Environment.NewLine + "Response time: " + pingresult1.RoundtripTime + "ms";
  16.     richTextBoxOutput.Text += Environment.NewLine + "Time to live: " + pingresult1.Options.Ttl;
  17.     richTextBoxOutput.Text += Environment.NewLine + "Don't fragment: " + pingresult1.Options.DontFragment;
  18.     richTextBoxOutput.Text += Environment.NewLine + "Buffer size: " + pingresult1.Buffer.Length;
  19.     richTextBoxOutput.Text += Environment.NewLine + "-------------------------------------------";
  20. }
  21. else
  22. {
  23.     pictureBoxRouter1.Image = Properties.Resources.router_offline;
  24.     toolTip0.SetToolTip(pictureBoxRouter1, "Ethernet: " + textBoxRouter1.Text + " | DOWN");
  25.  
  26.     PingReply pingresultS1 = ping.Send("192.168." + textBoxSerialAB.Text + ".2");
  27.     if (pingresultS1.Status.ToString() == "Success")
  28.     {
  29.         toolTip0.SetToolTip(pictureBoxRouter1, "Ethernet: " + textBoxRouter1.Text + " | DOWN" + Environment.NewLine + "Serial 0: " + "192.168." + textBoxSerialAB.Text + ".2" + " | UP");
  30.     }
  31.     else
  32.     {
  33.         toolTip0.SetToolTip(pictureBoxRouter1, "Ethernet: " + textBoxRouter1.Text + " | DOWN" + Environment.NewLine + "Serial 0: " + "192.168." + textBoxSerialAB.Text + ".2" + " | DOWN");
  34.     }
  35.  
  36.     PingReply pingresultS11 = ping.Send("192.168." + textBoxSerialBC.Text + ".1");
  37.     if (pingresultS11.Status.ToString() == "Success")
  38.     {
  39.         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");
  40.     }
  41.     else
  42.     {
  43.         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");
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment