FrmIPScan: Add Subnet selection textbox
This commit is contained in:
37
VAR.Toolbox/UI/FrmIPScan.Designer.cs
generated
37
VAR.Toolbox/UI/FrmIPScan.Designer.cs
generated
@@ -32,6 +32,7 @@
|
||||
this.btnScan = new System.Windows.Forms.Button();
|
||||
this.lblStatus = new System.Windows.Forms.Label();
|
||||
this.btnStop = new System.Windows.Forms.Button();
|
||||
this.txtSubnet = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lsvResult
|
||||
@@ -40,17 +41,18 @@
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lsvResult.FormattingEnabled = true;
|
||||
this.lsvResult.ItemHeight = 20;
|
||||
this.lsvResult.Location = new System.Drawing.Point(13, 62);
|
||||
this.lsvResult.Location = new System.Drawing.Point(9, 59);
|
||||
this.lsvResult.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.lsvResult.Name = "lsvResult";
|
||||
this.lsvResult.Size = new System.Drawing.Size(523, 404);
|
||||
this.lsvResult.Size = new System.Drawing.Size(350, 238);
|
||||
this.lsvResult.TabIndex = 0;
|
||||
//
|
||||
// btnScan
|
||||
//
|
||||
this.btnScan.Location = new System.Drawing.Point(13, 12);
|
||||
this.btnScan.Location = new System.Drawing.Point(9, 8);
|
||||
this.btnScan.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnScan.Name = "btnScan";
|
||||
this.btnScan.Size = new System.Drawing.Size(91, 33);
|
||||
this.btnScan.Size = new System.Drawing.Size(61, 21);
|
||||
this.btnScan.TabIndex = 1;
|
||||
this.btnScan.Text = "Scan";
|
||||
this.btnScan.UseVisualStyleBackColor = true;
|
||||
@@ -59,31 +61,43 @@
|
||||
// lblStatus
|
||||
//
|
||||
this.lblStatus.AutoSize = true;
|
||||
this.lblStatus.Location = new System.Drawing.Point(248, 18);
|
||||
this.lblStatus.Location = new System.Drawing.Point(165, 12);
|
||||
this.lblStatus.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblStatus.Name = "lblStatus";
|
||||
this.lblStatus.Size = new System.Drawing.Size(71, 20);
|
||||
this.lblStatus.Size = new System.Drawing.Size(47, 13);
|
||||
this.lblStatus.TabIndex = 2;
|
||||
this.lblStatus.Text = "lblStatus";
|
||||
//
|
||||
// btnStop
|
||||
//
|
||||
this.btnStop.Location = new System.Drawing.Point(110, 12);
|
||||
this.btnStop.Location = new System.Drawing.Point(73, 8);
|
||||
this.btnStop.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnStop.Name = "btnStop";
|
||||
this.btnStop.Size = new System.Drawing.Size(91, 33);
|
||||
this.btnStop.Size = new System.Drawing.Size(61, 21);
|
||||
this.btnStop.TabIndex = 3;
|
||||
this.btnStop.Text = "Stop";
|
||||
this.btnStop.UseVisualStyleBackColor = true;
|
||||
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
|
||||
//
|
||||
// txtSubnet
|
||||
//
|
||||
this.txtSubnet.Location = new System.Drawing.Point(9, 34);
|
||||
this.txtSubnet.Name = "txtSubnet";
|
||||
this.txtSubnet.Size = new System.Drawing.Size(100, 20);
|
||||
this.txtSubnet.TabIndex = 4;
|
||||
this.txtSubnet.Text = "192.168.0.";
|
||||
//
|
||||
// FrmIPScan
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(548, 473);
|
||||
this.ClientSize = new System.Drawing.Size(365, 307);
|
||||
this.Controls.Add(this.txtSubnet);
|
||||
this.Controls.Add(this.btnStop);
|
||||
this.Controls.Add(this.lblStatus);
|
||||
this.Controls.Add(this.btnScan);
|
||||
this.Controls.Add(this.lsvResult);
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.Name = "FrmIPScan";
|
||||
this.Text = "IPScan";
|
||||
this.ResumeLayout(false);
|
||||
@@ -97,5 +111,6 @@
|
||||
private System.Windows.Forms.Button btnScan;
|
||||
private System.Windows.Forms.Label lblStatus;
|
||||
private System.Windows.Forms.Button btnStop;
|
||||
private System.Windows.Forms.TextBox txtSubnet;
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ namespace VAR.Toolbox.UI
|
||||
|
||||
private void btnScan_Click(object sender, EventArgs e)
|
||||
{
|
||||
Thread thread = new Thread(() => { IPScan(); });
|
||||
Thread thread = new Thread(() => { IPScan(txtSubnet.Text); });
|
||||
thread.Start();
|
||||
}
|
||||
|
||||
@@ -68,12 +68,11 @@ namespace VAR.Toolbox.UI
|
||||
|
||||
private bool running = false;
|
||||
|
||||
private void IPScan()
|
||||
private void IPScan(string ipBase)
|
||||
{
|
||||
Control_SetEnabled(btnScan, false);
|
||||
running = true;
|
||||
ResultsAddLine(string.Format("IPScan started at {0}", DateTime.UtcNow.ToString("s")));
|
||||
string ipBase = "192.168.0.";
|
||||
for (int i = 1; i < 255 && running; i++)
|
||||
{
|
||||
string ip = ipBase + i.ToString();
|
||||
|
||||
Reference in New Issue
Block a user