Build 05.02.2021

Małe poprawki stylistyczne oraz w kodzie
Dodano Traceroute
This commit is contained in:
Christopher
2021-02-05 17:03:14 +01:00
parent ae59681bad
commit ae6fa2fcff
17 changed files with 2091 additions and 100 deletions
@@ -38,18 +38,20 @@ namespace NetworkInterface_Info
this.odświeżInformacjeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.czcionkaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.opcjeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tracerouteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.stworzonePrzezKrzysiekSiemvToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fontDialog1 = new System.Windows.Forms.FontDialog();
this.pingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.Color.White;
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.Cursor = System.Windows.Forms.Cursors.Default;
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.textBox1.HideSelection = false;
this.textBox1.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.textBox1.Location = new System.Drawing.Point(0, 24);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
@@ -104,11 +106,26 @@ namespace NetworkInterface_Info
// opcjeToolStripMenuItem
//
this.opcjeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.pingToolStripMenuItem});
this.pingToolStripMenuItem,
this.tracerouteToolStripMenuItem});
this.opcjeToolStripMenuItem.Name = "opcjeToolStripMenuItem";
this.opcjeToolStripMenuItem.Size = new System.Drawing.Size(70, 20);
this.opcjeToolStripMenuItem.Text = "Narzędzia";
//
// pingToolStripMenuItem
//
this.pingToolStripMenuItem.Name = "pingToolStripMenuItem";
this.pingToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.pingToolStripMenuItem.Text = "Ping";
this.pingToolStripMenuItem.Click += new System.EventHandler(this.pingToolStripMenuItem_Click);
//
// tracerouteToolStripMenuItem
//
this.tracerouteToolStripMenuItem.Name = "tracerouteToolStripMenuItem";
this.tracerouteToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.tracerouteToolStripMenuItem.Text = "Traceroute";
this.tracerouteToolStripMenuItem.Click += new System.EventHandler(this.tracerouteToolStripMenuItem_Click);
//
// stworzonePrzezKrzysiekSiemvToolStripMenuItem
//
this.stworzonePrzezKrzysiekSiemvToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
@@ -121,13 +138,6 @@ namespace NetworkInterface_Info
//
this.fontDialog1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
//
// pingToolStripMenuItem
//
this.pingToolStripMenuItem.Name = "pingToolStripMenuItem";
this.pingToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.pingToolStripMenuItem.Text = "Ping";
this.pingToolStripMenuItem.Click += new System.EventHandler(this.pingToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -138,7 +148,8 @@ namespace NetworkInterface_Info
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
this.Text = "NetworkInterfaces Info";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "NetworkInterfaces.Info";
this.Load += new System.EventHandler(this.onLoad);
this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged);
this.menuStrip1.ResumeLayout(false);
@@ -160,6 +171,7 @@ namespace NetworkInterface_Info
private System.Windows.Forms.ToolStripMenuItem opcjeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem stworzonePrzezKrzysiekSiemvToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem pingToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem tracerouteToolStripMenuItem;
}
}
@@ -143,5 +143,11 @@ namespace NetworkInterface_Info
ping ping = new ping();
ping.Show();
}
private void tracerouteToolStripMenuItem_Click(object sender, EventArgs e)
{
traceroute traceroute = new traceroute();
traceroute.Show();
}
}
}
@@ -1 +1 @@
eeffeecb8b26103caf5715dd58889694cefb3cfb
b6cfaaf8b879ee649e31987e93d7d0171b180f48
@@ -26,3 +26,18 @@ C:\Users\Krzysiek\Documents\GitHub\NetworkInterfaces-Info\Narzędzie diagnostycz
C:\Users\Krzysiek\Documents\GitHub\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\NetworkInterface Info.exe
C:\Users\Krzysiek\Documents\GitHub\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\NetworkInterface Info.pdb
C:\Users\Krzysiek\Documents\GitHub\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\NetworkInterface_Info.traceroute.resources
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\bin\Debug\NetworkInterface Info.exe.config
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\bin\Debug\NetworkInterface Info.exe
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\bin\Debug\NetworkInterface Info.pdb
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\bin\Debug\System.ValueTuple.dll
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\bin\Debug\System.ValueTuple.xml
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\Narzędzie diagnostyczne karty sieciowej.csprojAssemblyReference.cache
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\NetworkInterface_Info.Form1.resources
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\NetworkInterface_Info.ping.resources
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\NetworkInterface_Info.Properties.Resources.resources
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\NetworkInterface_Info.traceroute.resources
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\Narzędzie diagnostyczne karty sieciowej.csproj.GenerateResource.cache
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\Narzędzie diagnostyczne karty sieciowej.csproj.CoreCompileInputs.cache
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\Narzędzie diagnostyczne karty sieciowej.csproj.CopyComplete
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\NetworkInterface Info.exe
D:\GitHub (krzysiek-smaga@outlook.com)\NetworkInterfaces-Info\Narzędzie diagnostyczne karty sieciowej\Narzędzie diagnostyczne karty sieciowej\obj\Debug\NetworkInterface Info.pdb
@@ -34,7 +34,6 @@ namespace NetworkInterface_Info
this.panel1 = new System.Windows.Forms.Panel();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.miliseconds = new System.Windows.Forms.NumericUpDown();
@@ -51,7 +50,6 @@ namespace NetworkInterface_Info
//
this.panel1.Controls.Add(this.button3);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.miliseconds);
@@ -86,15 +84,6 @@ namespace NetworkInterface_Info
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.stopPing);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(189, 48);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(145, 13);
this.label4.TabIndex = 7;
this.label4.Text = "1 sekunda = 1000 milisekund";
//
// button1
//
this.button1.Location = new System.Drawing.Point(366, 12);
@@ -108,7 +97,7 @@ namespace NetworkInterface_Info
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(340, 28);
this.label3.Location = new System.Drawing.Point(262, 40);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(20, 13);
this.label3.TabIndex = 4;
@@ -116,14 +105,19 @@ namespace NetworkInterface_Info
//
// miliseconds
//
this.miliseconds.Location = new System.Drawing.Point(192, 25);
this.miliseconds.Location = new System.Drawing.Point(173, 38);
this.miliseconds.Maximum = new decimal(new int[] {
60000,
100000,
0,
0,
0});
this.miliseconds.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.miliseconds.Name = "miliseconds";
this.miliseconds.Size = new System.Drawing.Size(145, 20);
this.miliseconds.Size = new System.Drawing.Size(83, 20);
this.miliseconds.TabIndex = 3;
this.miliseconds.Value = new decimal(new int[] {
10000,
@@ -134,7 +128,7 @@ namespace NetworkInterface_Info
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(189, 9);
this.label2.Location = new System.Drawing.Point(12, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(155, 13);
this.label2.TabIndex = 2;
@@ -142,16 +136,16 @@ namespace NetworkInterface_Info
//
// server
//
this.server.Location = new System.Drawing.Point(12, 25);
this.server.Location = new System.Drawing.Point(173, 12);
this.server.Name = "server";
this.server.Size = new System.Drawing.Size(171, 20);
this.server.Size = new System.Drawing.Size(109, 20);
this.server.TabIndex = 1;
this.server.Text = "github.com";
this.server.Text = "onet.pl";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Location = new System.Drawing.Point(36, 15);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(131, 13);
this.label1.TabIndex = 0;
@@ -159,6 +153,7 @@ namespace NetworkInterface_Info
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.Color.White;
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.textBox1.Location = new System.Drawing.Point(0, 70);
@@ -182,12 +177,11 @@ namespace NetworkInterface_Info
this.Controls.Add(this.panel1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(560, 490);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(560, 490);
this.Name = "ping";
this.ShowIcon = false;
this.Text = "Ping";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Ping - NetworkInterfaces.Info";
this.Load += new System.EventHandler(this.onLoad);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
@@ -207,7 +201,6 @@ namespace NetworkInterface_Info
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Timer timer1;
@@ -27,7 +27,7 @@ namespace NetworkInterface_Info
byte[] buffer = Encoding.ASCII.GetBytes(data);
PingOptions options = new PingOptions(64, true);
PingReply pingReply = pingSender.Send(server.Text, Int32.Parse(miliseconds.Value.ToString()), buffer, options);
PingReply pingReply = pingSender.Send(server.Text, Convert.ToInt32(miliseconds.Value), buffer, options);
if (pingReply.Status == IPStatus.Success)
textBox1.Text += pingReply.Buffer.Length + " bajtów od " + server.Text + " (" + pingReply.Address + "): ttl=" + pingReply.Options.Ttl + " czas=" + pingReply.RoundtripTime + " ms" + Environment.NewLine;
@@ -30,109 +30,152 @@ namespace NetworkInterface_Info
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(traceroute));
this.panel1 = new System.Windows.Forms.Panel();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.clearText = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.server = new System.Windows.Forms.TextBox();
this.destination = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.listBox1 = new System.Windows.Forms.ListBox();
this.outputText = new System.Windows.Forms.RichTextBox();
this.dontShowHostnames = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.maxHops = new System.Windows.Forms.NumericUpDown();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.maxHops)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.button3);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.maxHops);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.dontShowHostnames);
this.panel1.Controls.Add(this.clearText);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.server);
this.panel1.Controls.Add(this.destination);
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.MaximumSize = new System.Drawing.Size(544, 70);
this.panel1.MinimumSize = new System.Drawing.Size(544, 70);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(544, 70);
this.panel1.Size = new System.Drawing.Size(544, 91);
this.panel1.TabIndex = 2;
//
// button3
// clearText
//
this.button3.Location = new System.Drawing.Point(450, 23);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(81, 23);
this.button3.TabIndex = 9;
this.button3.Text = "Wyczyść";
this.button3.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.Location = new System.Drawing.Point(363, 23);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(81, 23);
this.button2.TabIndex = 8;
this.button2.Text = "Stop";
this.button2.UseVisualStyleBackColor = true;
this.clearText.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.clearText.Location = new System.Drawing.Point(364, 51);
this.clearText.Name = "clearText";
this.clearText.Size = new System.Drawing.Size(168, 23);
this.clearText.TabIndex = 9;
this.clearText.Text = "Wyczyść";
this.clearText.UseVisualStyleBackColor = true;
this.clearText.Click += new System.EventHandler(this.clearText_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(189, 23);
this.button1.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.button1.Location = new System.Drawing.Point(364, 22);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(168, 23);
this.button1.TabIndex = 5;
this.button1.Text = "Trace!";
this.button1.Text = "Śledź!";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
this.button1.Click += new System.EventHandler(this.startTracing);
//
// server
// destination
//
this.server.Location = new System.Drawing.Point(15, 25);
this.server.Name = "server";
this.server.Size = new System.Drawing.Size(168, 20);
this.server.TabIndex = 1;
this.server.Text = "github.com";
this.destination.Location = new System.Drawing.Point(174, 14);
this.destination.Name = "destination";
this.destination.Size = new System.Drawing.Size(114, 20);
this.destination.TabIndex = 1;
this.destination.Text = "onet.pl";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Location = new System.Drawing.Point(33, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(131, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Cel (domena lub adres IP):";
//
// listBox1
// outputText
//
this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(0, 70);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(544, 381);
this.listBox1.TabIndex = 3;
this.outputText.BackColor = System.Drawing.Color.White;
this.outputText.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.outputText.Dock = System.Windows.Forms.DockStyle.Fill;
this.outputText.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.outputText.Location = new System.Drawing.Point(0, 91);
this.outputText.Name = "outputText";
this.outputText.ReadOnly = true;
this.outputText.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical;
this.outputText.Size = new System.Drawing.Size(544, 360);
this.outputText.TabIndex = 3;
this.outputText.Text = "";
//
// dontShowHostnames
//
this.dontShowHostnames.AutoSize = true;
this.dontShowHostnames.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.dontShowHostnames.Location = new System.Drawing.Point(36, 40);
this.dontShowHostnames.Name = "dontShowHostnames";
this.dontShowHostnames.Size = new System.Drawing.Size(152, 17);
this.dontShowHostnames.TabIndex = 10;
this.dontShowHostnames.Text = "Nie pokazuj nazwy hostów";
this.dontShowHostnames.UseVisualStyleBackColor = true;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 65);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(159, 13);
this.label2.TabIndex = 11;
this.label2.Text = "Maksymalna liczba przeskoków:";
//
// maxHops
//
this.maxHops.Location = new System.Drawing.Point(174, 63);
this.maxHops.Name = "maxHops";
this.maxHops.Size = new System.Drawing.Size(89, 20);
this.maxHops.TabIndex = 12;
this.maxHops.Value = new decimal(new int[] {
30,
0,
0,
0});
//
// traceroute
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(544, 451);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.outputText);
this.Controls.Add(this.panel1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(560, 490);
this.Name = "traceroute";
this.Text = "traceroute";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Trace Route - NetworkInterfaces.Info";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.maxHops)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button clearText;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox server;
private System.Windows.Forms.TextBox destination;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.RichTextBox outputText;
private System.Windows.Forms.CheckBox dontShowHostnames;
private System.Windows.Forms.NumericUpDown maxHops;
private System.Windows.Forms.Label label2;
}
}
@@ -1,25 +1,57 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
namespace NetworkInterface_Info
{
public partial class traceroute : Form
{
public traceroute()
Thread thread;
Process process;
public traceroute() { InitializeComponent(); }
private void startTracing(object sender, EventArgs e) { TraceIt(destination.Text, dontShowHostnames.Checked); }
private void clearText_Click(object sender, EventArgs e) { outputText.Text = ""; }
public void TraceIt(string url, bool dontShowHostnames)
{
InitializeComponent();
outputText.Text = "";
string arguments;
if (!dontShowHostnames)
arguments = "-h " + Convert.ToString(maxHops.Value) + " " + url;
else
arguments = "-d -h " + Convert.ToString(maxHops.Value) + " " + url;
process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "TRACERT.exe",
Arguments = arguments,
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardOutput = true
}
};
thread = new Thread(() => {
process.Start();
while (!process.StandardOutput.EndOfStream)
{
string line = process.StandardOutput.ReadLine();
BeginInvoke(new Action(() => {
outputText.Text += line + Environment.NewLine;
}));
}
private void button1_Click(object sender, EventArgs e)
{
process.WaitForExit();
});
thread.Start();
}
}
}
}