diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/06cbc1cd-2c4f-44f6-a463-a18198dc3909.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/06cbc1cd-2c4f-44f6-a463-a18198dc3909.vsidx
new file mode 100644
index 000000000..cfbc5d843
Binary files /dev/null and b/AgroBase/.vs/AgroBase/FileContentIndex/06cbc1cd-2c4f-44f6-a463-a18198dc3909.vsidx differ
diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/0e09bb0e-a015-4f97-bfac-925e2e581a67.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/0e09bb0e-a015-4f97-bfac-925e2e581a67.vsidx
deleted file mode 100644
index b69e1a14a..000000000
Binary files a/AgroBase/.vs/AgroBase/FileContentIndex/0e09bb0e-a015-4f97-bfac-925e2e581a67.vsidx and /dev/null differ
diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/237273f7-2192-49f9-ac07-351d9366628b.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/237273f7-2192-49f9-ac07-351d9366628b.vsidx
deleted file mode 100644
index 2f578bb9c..000000000
Binary files a/AgroBase/.vs/AgroBase/FileContentIndex/237273f7-2192-49f9-ac07-351d9366628b.vsidx and /dev/null differ
diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/7885a88e-7dcc-4ea2-b484-c9e276893077.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/7885a88e-7dcc-4ea2-b484-c9e276893077.vsidx
new file mode 100644
index 000000000..c69684400
Binary files /dev/null and b/AgroBase/.vs/AgroBase/FileContentIndex/7885a88e-7dcc-4ea2-b484-c9e276893077.vsidx differ
diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/be840ab2-d741-4c56-bc94-cf22718c237d.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/be840ab2-d741-4c56-bc94-cf22718c237d.vsidx
new file mode 100644
index 000000000..e93d62b12
Binary files /dev/null and b/AgroBase/.vs/AgroBase/FileContentIndex/be840ab2-d741-4c56-bc94-cf22718c237d.vsidx differ
diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/c27b6b22-71aa-422d-94a1-c711818250f4.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/c27b6b22-71aa-422d-94a1-c711818250f4.vsidx
deleted file mode 100644
index d293fcb49..000000000
Binary files a/AgroBase/.vs/AgroBase/FileContentIndex/c27b6b22-71aa-422d-94a1-c711818250f4.vsidx and /dev/null differ
diff --git a/AgroBase/.vs/AgroBase/v17/.suo b/AgroBase/.vs/AgroBase/v17/.suo
index ca8d828dd..c71bdaa62 100644
Binary files a/AgroBase/.vs/AgroBase/v17/.suo and b/AgroBase/.vs/AgroBase/v17/.suo differ
diff --git a/AgroBase/AgroBase/AgroBase.csproj b/AgroBase/AgroBase/AgroBase.csproj
index 92eba2bba..38bf0f1b6 100644
--- a/AgroBase/AgroBase/AgroBase.csproj
+++ b/AgroBase/AgroBase/AgroBase.csproj
@@ -482,6 +482,7 @@
+
diff --git a/AgroBase/AgroBase/Forms/frmEthernet.Designer.cs b/AgroBase/AgroBase/Forms/frmEthernet.Designer.cs
index 4ebfa9f51..1ec27eb03 100644
--- a/AgroBase/AgroBase/Forms/frmEthernet.Designer.cs
+++ b/AgroBase/AgroBase/Forms/frmEthernet.Designer.cs
@@ -38,12 +38,50 @@
this.lblInterface = new System.Windows.Forms.Label();
this.txtSubmask = new System.Windows.Forms.TextBox();
this.lblSubmask = new System.Windows.Forms.Label();
+ this.gpbPC = new System.Windows.Forms.GroupBox();
+ this.gpbMov = new System.Windows.Forms.GroupBox();
+ this.btnDefinirIP_Mov = new System.Windows.Forms.Button();
+ this.txtSubmask_Mov = new System.Windows.Forms.TextBox();
+ this.lblIP_Mov = new System.Windows.Forms.Label();
+ this.lblGateway_Mov = new System.Windows.Forms.Label();
+ this.lblIPAtual_Mov = new System.Windows.Forms.Label();
+ this.lblSubmask_Mov = new System.Windows.Forms.Label();
+ this.txtIP_Mov = new System.Windows.Forms.TextBox();
+ this.txtGateway_Mov = new System.Windows.Forms.TextBox();
+ this.cmbIP_Mov = new System.Windows.Forms.ComboBox();
+ this.gpbDir = new System.Windows.Forms.GroupBox();
+ this.btnDefinirIP_Dir = new System.Windows.Forms.Button();
+ this.txtSubmask_Dir = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.lblGateway_Dir = new System.Windows.Forms.Label();
+ this.lblIPAtual_Dir = new System.Windows.Forms.Label();
+ this.lblSubmask_Dir = new System.Windows.Forms.Label();
+ this.txtIP_Dir = new System.Windows.Forms.TextBox();
+ this.txtGateway_Dir = new System.Windows.Forms.TextBox();
+ this.cmbIP_Dir = new System.Windows.Forms.ComboBox();
+ this.gpbVarredura = new System.Windows.Forms.GroupBox();
+ this.lblAlterados = new System.Windows.Forms.Label();
+ this.tvwAlterados = new System.Windows.Forms.TreeView();
+ this.btnVerificarAlteracoes = new System.Windows.Forms.Button();
+ this.lblEncontrados = new System.Windows.Forms.Label();
+ this.lblEscaneados = new System.Windows.Forms.Label();
+ this.tvwEncontrados = new System.Windows.Forms.TreeView();
+ this.tvwEscaneados = new System.Windows.Forms.TreeView();
+ this.btnIniciarVarredura = new System.Windows.Forms.Button();
+ this.txtFaixaIP = new System.Windows.Forms.TextBox();
+ this.lblFaixaIP = new System.Windows.Forms.Label();
+ this.chbConectado_Mov = new System.Windows.Forms.CheckBox();
+ this.chbConectado_Dir = new System.Windows.Forms.CheckBox();
+ this.gpbPC.SuspendLayout();
+ this.gpbMov.SuspendLayout();
+ this.gpbDir.SuspendLayout();
+ this.gpbVarredura.SuspendLayout();
this.SuspendLayout();
//
// lblGateway
//
this.lblGateway.AutoSize = true;
- this.lblGateway.Location = new System.Drawing.Point(12, 49);
+ this.lblGateway.Location = new System.Drawing.Point(6, 61);
this.lblGateway.Name = "lblGateway";
this.lblGateway.Size = new System.Drawing.Size(49, 13);
this.lblGateway.TabIndex = 0;
@@ -52,7 +90,7 @@
// lblIpAtual
//
this.lblIpAtual.AutoSize = true;
- this.lblIpAtual.Location = new System.Drawing.Point(12, 127);
+ this.lblIpAtual.Location = new System.Drawing.Point(6, 139);
this.lblIpAtual.Name = "lblIpAtual";
this.lblIpAtual.Size = new System.Drawing.Size(44, 13);
this.lblIpAtual.TabIndex = 1;
@@ -61,7 +99,7 @@
// txtGateway
//
this.txtGateway.Enabled = false;
- this.txtGateway.Location = new System.Drawing.Point(15, 65);
+ this.txtGateway.Location = new System.Drawing.Point(9, 77);
this.txtGateway.Name = "txtGateway";
this.txtGateway.Size = new System.Drawing.Size(141, 20);
this.txtGateway.TabIndex = 2;
@@ -70,7 +108,7 @@
// txtIpAtual
//
this.txtIpAtual.Enabled = false;
- this.txtIpAtual.Location = new System.Drawing.Point(15, 143);
+ this.txtIpAtual.Location = new System.Drawing.Point(9, 155);
this.txtIpAtual.Name = "txtIpAtual";
this.txtIpAtual.Size = new System.Drawing.Size(141, 20);
this.txtIpAtual.TabIndex = 4;
@@ -78,7 +116,7 @@
//
// btnDefinirIp
//
- this.btnDefinirIp.Location = new System.Drawing.Point(15, 197);
+ this.btnDefinirIp.Location = new System.Drawing.Point(9, 209);
this.btnDefinirIp.Name = "btnDefinirIp";
this.btnDefinirIp.Size = new System.Drawing.Size(141, 23);
this.btnDefinirIp.TabIndex = 6;
@@ -89,7 +127,7 @@
// chbIpFixo
//
this.chbIpFixo.AutoSize = true;
- this.chbIpFixo.Location = new System.Drawing.Point(15, 170);
+ this.chbIpFixo.Location = new System.Drawing.Point(9, 182);
this.chbIpFixo.Name = "chbIpFixo";
this.chbIpFixo.Size = new System.Drawing.Size(58, 17);
this.chbIpFixo.TabIndex = 5;
@@ -101,15 +139,16 @@
//
this.cmbInterface.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbInterface.FormattingEnabled = true;
- this.cmbInterface.Location = new System.Drawing.Point(15, 25);
+ this.cmbInterface.Location = new System.Drawing.Point(9, 37);
this.cmbInterface.Name = "cmbInterface";
this.cmbInterface.Size = new System.Drawing.Size(141, 21);
this.cmbInterface.TabIndex = 1;
+ this.cmbInterface.SelectedIndexChanged += new System.EventHandler(this.cmbInterface_SelectedIndexChanged);
//
// lblInterface
//
this.lblInterface.AutoSize = true;
- this.lblInterface.Location = new System.Drawing.Point(12, 9);
+ this.lblInterface.Location = new System.Drawing.Point(6, 21);
this.lblInterface.Name = "lblInterface";
this.lblInterface.Size = new System.Drawing.Size(49, 13);
this.lblInterface.TabIndex = 7;
@@ -118,7 +157,7 @@
// txtSubmask
//
this.txtSubmask.Enabled = false;
- this.txtSubmask.Location = new System.Drawing.Point(15, 104);
+ this.txtSubmask.Location = new System.Drawing.Point(9, 116);
this.txtSubmask.Name = "txtSubmask";
this.txtSubmask.Size = new System.Drawing.Size(141, 20);
this.txtSubmask.TabIndex = 3;
@@ -127,32 +166,388 @@
// lblSubmask
//
this.lblSubmask.AutoSize = true;
- this.lblSubmask.Location = new System.Drawing.Point(12, 88);
+ this.lblSubmask.Location = new System.Drawing.Point(6, 100);
this.lblSubmask.Name = "lblSubmask";
this.lblSubmask.Size = new System.Drawing.Size(70, 13);
this.lblSubmask.TabIndex = 8;
this.lblSubmask.Text = "Subnet Mask";
//
+ // gpbPC
+ //
+ this.gpbPC.Controls.Add(this.lblInterface);
+ this.gpbPC.Controls.Add(this.txtSubmask);
+ this.gpbPC.Controls.Add(this.lblGateway);
+ this.gpbPC.Controls.Add(this.lblSubmask);
+ this.gpbPC.Controls.Add(this.lblIpAtual);
+ this.gpbPC.Controls.Add(this.txtGateway);
+ this.gpbPC.Controls.Add(this.cmbInterface);
+ this.gpbPC.Controls.Add(this.txtIpAtual);
+ this.gpbPC.Controls.Add(this.chbIpFixo);
+ this.gpbPC.Controls.Add(this.btnDefinirIp);
+ this.gpbPC.Location = new System.Drawing.Point(12, 12);
+ this.gpbPC.Name = "gpbPC";
+ this.gpbPC.Size = new System.Drawing.Size(162, 245);
+ this.gpbPC.TabIndex = 9;
+ this.gpbPC.TabStop = false;
+ this.gpbPC.Text = "Eqipamento";
+ //
+ // gpbMov
+ //
+ this.gpbMov.Controls.Add(this.chbConectado_Mov);
+ this.gpbMov.Controls.Add(this.btnDefinirIP_Mov);
+ this.gpbMov.Controls.Add(this.txtSubmask_Mov);
+ this.gpbMov.Controls.Add(this.lblIP_Mov);
+ this.gpbMov.Controls.Add(this.lblGateway_Mov);
+ this.gpbMov.Controls.Add(this.lblIPAtual_Mov);
+ this.gpbMov.Controls.Add(this.lblSubmask_Mov);
+ this.gpbMov.Controls.Add(this.txtIP_Mov);
+ this.gpbMov.Controls.Add(this.txtGateway_Mov);
+ this.gpbMov.Controls.Add(this.cmbIP_Mov);
+ this.gpbMov.Enabled = false;
+ this.gpbMov.Location = new System.Drawing.Point(180, 12);
+ this.gpbMov.Name = "gpbMov";
+ this.gpbMov.Size = new System.Drawing.Size(162, 245);
+ this.gpbMov.TabIndex = 10;
+ this.gpbMov.TabStop = false;
+ this.gpbMov.Text = "Movimentação";
+ //
+ // btnDefinirIP_Mov
+ //
+ this.btnDefinirIP_Mov.Enabled = false;
+ this.btnDefinirIP_Mov.Location = new System.Drawing.Point(8, 209);
+ this.btnDefinirIP_Mov.Name = "btnDefinirIP_Mov";
+ this.btnDefinirIP_Mov.Size = new System.Drawing.Size(141, 23);
+ this.btnDefinirIP_Mov.TabIndex = 9;
+ this.btnDefinirIP_Mov.Text = "Definir IP";
+ this.btnDefinirIP_Mov.UseVisualStyleBackColor = true;
+ this.btnDefinirIP_Mov.Click += new System.EventHandler(this.btnDefinirIP_Mov_Click);
+ //
+ // txtSubmask_Mov
+ //
+ this.txtSubmask_Mov.Enabled = false;
+ this.txtSubmask_Mov.Location = new System.Drawing.Point(8, 116);
+ this.txtSubmask_Mov.Name = "txtSubmask_Mov";
+ this.txtSubmask_Mov.Size = new System.Drawing.Size(141, 20);
+ this.txtSubmask_Mov.TabIndex = 11;
+ this.txtSubmask_Mov.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ //
+ // lblIP_Mov
+ //
+ this.lblIP_Mov.AutoSize = true;
+ this.lblIP_Mov.Location = new System.Drawing.Point(5, 139);
+ this.lblIP_Mov.Name = "lblIP_Mov";
+ this.lblIP_Mov.Size = new System.Drawing.Size(46, 13);
+ this.lblIP_Mov.TabIndex = 9;
+ this.lblIP_Mov.Text = "Novo IP";
+ //
+ // lblGateway_Mov
+ //
+ this.lblGateway_Mov.AutoSize = true;
+ this.lblGateway_Mov.Location = new System.Drawing.Point(5, 61);
+ this.lblGateway_Mov.Name = "lblGateway_Mov";
+ this.lblGateway_Mov.Size = new System.Drawing.Size(49, 13);
+ this.lblGateway_Mov.TabIndex = 9;
+ this.lblGateway_Mov.Text = "Gateway";
+ //
+ // lblIPAtual_Mov
+ //
+ this.lblIPAtual_Mov.AutoSize = true;
+ this.lblIPAtual_Mov.Location = new System.Drawing.Point(5, 21);
+ this.lblIPAtual_Mov.Name = "lblIPAtual_Mov";
+ this.lblIPAtual_Mov.Size = new System.Drawing.Size(44, 13);
+ this.lblIPAtual_Mov.TabIndex = 10;
+ this.lblIPAtual_Mov.Text = "IP Atual";
+ //
+ // lblSubmask_Mov
+ //
+ this.lblSubmask_Mov.AutoSize = true;
+ this.lblSubmask_Mov.Location = new System.Drawing.Point(5, 100);
+ this.lblSubmask_Mov.Name = "lblSubmask_Mov";
+ this.lblSubmask_Mov.Size = new System.Drawing.Size(70, 13);
+ this.lblSubmask_Mov.TabIndex = 12;
+ this.lblSubmask_Mov.Text = "Subnet Mask";
+ //
+ // txtIP_Mov
+ //
+ this.txtIP_Mov.Enabled = false;
+ this.txtIP_Mov.Location = new System.Drawing.Point(8, 155);
+ this.txtIP_Mov.Name = "txtIP_Mov";
+ this.txtIP_Mov.Size = new System.Drawing.Size(141, 20);
+ this.txtIP_Mov.TabIndex = 10;
+ this.txtIP_Mov.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ //
+ // txtGateway_Mov
+ //
+ this.txtGateway_Mov.Enabled = false;
+ this.txtGateway_Mov.Location = new System.Drawing.Point(8, 77);
+ this.txtGateway_Mov.Name = "txtGateway_Mov";
+ this.txtGateway_Mov.Size = new System.Drawing.Size(141, 20);
+ this.txtGateway_Mov.TabIndex = 10;
+ this.txtGateway_Mov.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ //
+ // cmbIP_Mov
+ //
+ this.cmbIP_Mov.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbIP_Mov.FormattingEnabled = true;
+ this.cmbIP_Mov.Location = new System.Drawing.Point(8, 37);
+ this.cmbIP_Mov.Name = "cmbIP_Mov";
+ this.cmbIP_Mov.Size = new System.Drawing.Size(141, 21);
+ this.cmbIP_Mov.TabIndex = 9;
+ this.cmbIP_Mov.SelectedIndexChanged += new System.EventHandler(this.cmbIP_Disp_SelectedIndexChanged);
+ //
+ // gpbDir
+ //
+ this.gpbDir.Controls.Add(this.chbConectado_Dir);
+ this.gpbDir.Controls.Add(this.btnDefinirIP_Dir);
+ this.gpbDir.Controls.Add(this.txtSubmask_Dir);
+ this.gpbDir.Controls.Add(this.label1);
+ this.gpbDir.Controls.Add(this.lblGateway_Dir);
+ this.gpbDir.Controls.Add(this.lblIPAtual_Dir);
+ this.gpbDir.Controls.Add(this.lblSubmask_Dir);
+ this.gpbDir.Controls.Add(this.txtIP_Dir);
+ this.gpbDir.Controls.Add(this.txtGateway_Dir);
+ this.gpbDir.Controls.Add(this.cmbIP_Dir);
+ this.gpbDir.Enabled = false;
+ this.gpbDir.Location = new System.Drawing.Point(348, 12);
+ this.gpbDir.Name = "gpbDir";
+ this.gpbDir.Size = new System.Drawing.Size(162, 245);
+ this.gpbDir.TabIndex = 11;
+ this.gpbDir.TabStop = false;
+ this.gpbDir.Text = "Direcional";
+ //
+ // btnDefinirIP_Dir
+ //
+ this.btnDefinirIP_Dir.Enabled = false;
+ this.btnDefinirIP_Dir.Location = new System.Drawing.Point(8, 209);
+ this.btnDefinirIP_Dir.Name = "btnDefinirIP_Dir";
+ this.btnDefinirIP_Dir.Size = new System.Drawing.Size(141, 23);
+ this.btnDefinirIP_Dir.TabIndex = 13;
+ this.btnDefinirIP_Dir.Text = "Definir IP";
+ this.btnDefinirIP_Dir.UseVisualStyleBackColor = true;
+ this.btnDefinirIP_Dir.Click += new System.EventHandler(this.btnDefinirIP_Dir_Click);
+ //
+ // txtSubmask_Dir
+ //
+ this.txtSubmask_Dir.Enabled = false;
+ this.txtSubmask_Dir.Location = new System.Drawing.Point(8, 116);
+ this.txtSubmask_Dir.Name = "txtSubmask_Dir";
+ this.txtSubmask_Dir.Size = new System.Drawing.Size(141, 20);
+ this.txtSubmask_Dir.TabIndex = 20;
+ this.txtSubmask_Dir.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(5, 139);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(46, 13);
+ this.label1.TabIndex = 14;
+ this.label1.Text = "Novo IP";
+ //
+ // lblGateway_Dir
+ //
+ this.lblGateway_Dir.AutoSize = true;
+ this.lblGateway_Dir.Location = new System.Drawing.Point(5, 61);
+ this.lblGateway_Dir.Name = "lblGateway_Dir";
+ this.lblGateway_Dir.Size = new System.Drawing.Size(49, 13);
+ this.lblGateway_Dir.TabIndex = 15;
+ this.lblGateway_Dir.Text = "Gateway";
+ //
+ // lblIPAtual_Dir
+ //
+ this.lblIPAtual_Dir.AutoSize = true;
+ this.lblIPAtual_Dir.Location = new System.Drawing.Point(5, 21);
+ this.lblIPAtual_Dir.Name = "lblIPAtual_Dir";
+ this.lblIPAtual_Dir.Size = new System.Drawing.Size(44, 13);
+ this.lblIPAtual_Dir.TabIndex = 17;
+ this.lblIPAtual_Dir.Text = "IP Atual";
+ //
+ // lblSubmask_Dir
+ //
+ this.lblSubmask_Dir.AutoSize = true;
+ this.lblSubmask_Dir.Location = new System.Drawing.Point(5, 100);
+ this.lblSubmask_Dir.Name = "lblSubmask_Dir";
+ this.lblSubmask_Dir.Size = new System.Drawing.Size(70, 13);
+ this.lblSubmask_Dir.TabIndex = 21;
+ this.lblSubmask_Dir.Text = "Subnet Mask";
+ //
+ // txtIP_Dir
+ //
+ this.txtIP_Dir.Enabled = false;
+ this.txtIP_Dir.Location = new System.Drawing.Point(8, 155);
+ this.txtIP_Dir.Name = "txtIP_Dir";
+ this.txtIP_Dir.Size = new System.Drawing.Size(141, 20);
+ this.txtIP_Dir.TabIndex = 18;
+ this.txtIP_Dir.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ //
+ // txtGateway_Dir
+ //
+ this.txtGateway_Dir.Enabled = false;
+ this.txtGateway_Dir.Location = new System.Drawing.Point(8, 77);
+ this.txtGateway_Dir.Name = "txtGateway_Dir";
+ this.txtGateway_Dir.Size = new System.Drawing.Size(141, 20);
+ this.txtGateway_Dir.TabIndex = 19;
+ this.txtGateway_Dir.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ //
+ // cmbIP_Dir
+ //
+ this.cmbIP_Dir.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbIP_Dir.FormattingEnabled = true;
+ this.cmbIP_Dir.Location = new System.Drawing.Point(8, 37);
+ this.cmbIP_Dir.Name = "cmbIP_Dir";
+ this.cmbIP_Dir.Size = new System.Drawing.Size(141, 21);
+ this.cmbIP_Dir.TabIndex = 16;
+ this.cmbIP_Dir.SelectedIndexChanged += new System.EventHandler(this.cmbIP_Disp_SelectedIndexChanged);
+ //
+ // gpbVarredura
+ //
+ this.gpbVarredura.Controls.Add(this.lblAlterados);
+ this.gpbVarredura.Controls.Add(this.tvwAlterados);
+ this.gpbVarredura.Controls.Add(this.btnVerificarAlteracoes);
+ this.gpbVarredura.Controls.Add(this.lblEncontrados);
+ this.gpbVarredura.Controls.Add(this.lblEscaneados);
+ this.gpbVarredura.Controls.Add(this.tvwEncontrados);
+ this.gpbVarredura.Controls.Add(this.tvwEscaneados);
+ this.gpbVarredura.Controls.Add(this.btnIniciarVarredura);
+ this.gpbVarredura.Controls.Add(this.txtFaixaIP);
+ this.gpbVarredura.Controls.Add(this.lblFaixaIP);
+ this.gpbVarredura.Location = new System.Drawing.Point(12, 263);
+ this.gpbVarredura.Name = "gpbVarredura";
+ this.gpbVarredura.Size = new System.Drawing.Size(498, 282);
+ this.gpbVarredura.TabIndex = 12;
+ this.gpbVarredura.TabStop = false;
+ this.gpbVarredura.Text = "Varredura automática";
+ //
+ // lblAlterados
+ //
+ this.lblAlterados.AutoSize = true;
+ this.lblAlterados.Location = new System.Drawing.Point(341, 80);
+ this.lblAlterados.Name = "lblAlterados";
+ this.lblAlterados.Size = new System.Drawing.Size(104, 13);
+ this.lblAlterados.TabIndex = 17;
+ this.lblAlterados.Text = "Endereços alterados";
+ //
+ // tvwAlterados
+ //
+ this.tvwAlterados.Location = new System.Drawing.Point(344, 96);
+ this.tvwAlterados.Name = "tvwAlterados";
+ this.tvwAlterados.Size = new System.Drawing.Size(141, 180);
+ this.tvwAlterados.TabIndex = 16;
+ //
+ // btnVerificarAlteracoes
+ //
+ this.btnVerificarAlteracoes.Location = new System.Drawing.Point(344, 39);
+ this.btnVerificarAlteracoes.Name = "btnVerificarAlteracoes";
+ this.btnVerificarAlteracoes.Size = new System.Drawing.Size(141, 23);
+ this.btnVerificarAlteracoes.TabIndex = 15;
+ this.btnVerificarAlteracoes.Text = "Verificar Alterações";
+ this.btnVerificarAlteracoes.UseVisualStyleBackColor = true;
+ this.btnVerificarAlteracoes.Click += new System.EventHandler(this.btnVerificarAlteracoes_Click);
+ //
+ // lblEncontrados
+ //
+ this.lblEncontrados.AutoSize = true;
+ this.lblEncontrados.Location = new System.Drawing.Point(173, 80);
+ this.lblEncontrados.Name = "lblEncontrados";
+ this.lblEncontrados.Size = new System.Drawing.Size(120, 13);
+ this.lblEncontrados.TabIndex = 14;
+ this.lblEncontrados.Text = "Endereços encontrados";
+ //
+ // lblEscaneados
+ //
+ this.lblEscaneados.AutoSize = true;
+ this.lblEscaneados.Location = new System.Drawing.Point(6, 80);
+ this.lblEscaneados.Name = "lblEscaneados";
+ this.lblEscaneados.Size = new System.Drawing.Size(119, 13);
+ this.lblEscaneados.TabIndex = 13;
+ this.lblEscaneados.Text = "Endereços escaneados";
+ //
+ // tvwEncontrados
+ //
+ this.tvwEncontrados.Location = new System.Drawing.Point(176, 96);
+ this.tvwEncontrados.Name = "tvwEncontrados";
+ this.tvwEncontrados.Size = new System.Drawing.Size(141, 180);
+ this.tvwEncontrados.TabIndex = 12;
+ //
+ // tvwEscaneados
+ //
+ this.tvwEscaneados.Location = new System.Drawing.Point(9, 96);
+ this.tvwEscaneados.Name = "tvwEscaneados";
+ this.tvwEscaneados.Size = new System.Drawing.Size(141, 180);
+ this.tvwEscaneados.TabIndex = 11;
+ //
+ // btnIniciarVarredura
+ //
+ this.btnIniciarVarredura.Location = new System.Drawing.Point(176, 39);
+ this.btnIniciarVarredura.Name = "btnIniciarVarredura";
+ this.btnIniciarVarredura.Size = new System.Drawing.Size(141, 23);
+ this.btnIniciarVarredura.TabIndex = 9;
+ this.btnIniciarVarredura.Text = "Iniciar Varredura";
+ this.btnIniciarVarredura.UseVisualStyleBackColor = true;
+ this.btnIniciarVarredura.Click += new System.EventHandler(this.btnIniciarVarredura_Click);
+ //
+ // txtFaixaIP
+ //
+ this.txtFaixaIP.Location = new System.Drawing.Point(9, 41);
+ this.txtFaixaIP.Name = "txtFaixaIP";
+ this.txtFaixaIP.Size = new System.Drawing.Size(141, 20);
+ this.txtFaixaIP.TabIndex = 9;
+ this.txtFaixaIP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ //
+ // lblFaixaIP
+ //
+ this.lblFaixaIP.AutoSize = true;
+ this.lblFaixaIP.Location = new System.Drawing.Point(6, 25);
+ this.lblFaixaIP.Name = "lblFaixaIP";
+ this.lblFaixaIP.Size = new System.Drawing.Size(60, 13);
+ this.lblFaixaIP.TabIndex = 10;
+ this.lblFaixaIP.Text = "Faixa de IP";
+ //
+ // chbConectado_Mov
+ //
+ this.chbConectado_Mov.AutoSize = true;
+ this.chbConectado_Mov.Enabled = false;
+ this.chbConectado_Mov.Location = new System.Drawing.Point(8, 182);
+ this.chbConectado_Mov.Name = "chbConectado_Mov";
+ this.chbConectado_Mov.Size = new System.Drawing.Size(78, 17);
+ this.chbConectado_Mov.TabIndex = 13;
+ this.chbConectado_Mov.Text = "Conectado";
+ this.chbConectado_Mov.UseVisualStyleBackColor = true;
+ //
+ // chbConectado_Dir
+ //
+ this.chbConectado_Dir.AutoSize = true;
+ this.chbConectado_Dir.Enabled = false;
+ this.chbConectado_Dir.Location = new System.Drawing.Point(8, 182);
+ this.chbConectado_Dir.Name = "chbConectado_Dir";
+ this.chbConectado_Dir.Size = new System.Drawing.Size(78, 17);
+ this.chbConectado_Dir.TabIndex = 14;
+ this.chbConectado_Dir.Text = "Conectado";
+ this.chbConectado_Dir.UseVisualStyleBackColor = true;
+ //
// frmEthernet
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(267, 232);
- this.Controls.Add(this.txtSubmask);
- this.Controls.Add(this.lblSubmask);
- this.Controls.Add(this.lblInterface);
- this.Controls.Add(this.cmbInterface);
- this.Controls.Add(this.chbIpFixo);
- this.Controls.Add(this.btnDefinirIp);
- this.Controls.Add(this.txtIpAtual);
- this.Controls.Add(this.txtGateway);
- this.Controls.Add(this.lblIpAtual);
- this.Controls.Add(this.lblGateway);
+ this.ClientSize = new System.Drawing.Size(519, 557);
+ this.Controls.Add(this.gpbVarredura);
+ this.Controls.Add(this.gpbDir);
+ this.Controls.Add(this.gpbMov);
+ this.Controls.Add(this.gpbPC);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.MaximizeBox = false;
this.Name = "frmEthernet";
this.Text = "Configurações de Rede";
this.Load += new System.EventHandler(this.frmEthernet_Load);
+ this.gpbPC.ResumeLayout(false);
+ this.gpbPC.PerformLayout();
+ this.gpbMov.ResumeLayout(false);
+ this.gpbMov.PerformLayout();
+ this.gpbDir.ResumeLayout(false);
+ this.gpbDir.PerformLayout();
+ this.gpbVarredura.ResumeLayout(false);
+ this.gpbVarredura.PerformLayout();
this.ResumeLayout(false);
- this.PerformLayout();
}
@@ -168,5 +563,39 @@
private System.Windows.Forms.Label lblInterface;
private System.Windows.Forms.TextBox txtSubmask;
private System.Windows.Forms.Label lblSubmask;
+ private System.Windows.Forms.GroupBox gpbPC;
+ private System.Windows.Forms.GroupBox gpbMov;
+ private System.Windows.Forms.GroupBox gpbDir;
+ private System.Windows.Forms.GroupBox gpbVarredura;
+ private System.Windows.Forms.TextBox txtFaixaIP;
+ private System.Windows.Forms.Label lblFaixaIP;
+ private System.Windows.Forms.Label lblEncontrados;
+ private System.Windows.Forms.Label lblEscaneados;
+ private System.Windows.Forms.TreeView tvwEncontrados;
+ private System.Windows.Forms.TreeView tvwEscaneados;
+ private System.Windows.Forms.Button btnIniciarVarredura;
+ private System.Windows.Forms.Label lblAlterados;
+ private System.Windows.Forms.TreeView tvwAlterados;
+ private System.Windows.Forms.Button btnVerificarAlteracoes;
+ private System.Windows.Forms.Label lblIPAtual_Mov;
+ private System.Windows.Forms.ComboBox cmbIP_Mov;
+ private System.Windows.Forms.Label lblIP_Mov;
+ private System.Windows.Forms.TextBox txtIP_Mov;
+ private System.Windows.Forms.Button btnDefinirIP_Mov;
+ private System.Windows.Forms.Button btnDefinirIP_Dir;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label lblIPAtual_Dir;
+ private System.Windows.Forms.TextBox txtIP_Dir;
+ private System.Windows.Forms.ComboBox cmbIP_Dir;
+ private System.Windows.Forms.TextBox txtSubmask_Mov;
+ private System.Windows.Forms.Label lblGateway_Mov;
+ private System.Windows.Forms.Label lblSubmask_Mov;
+ private System.Windows.Forms.TextBox txtGateway_Mov;
+ private System.Windows.Forms.TextBox txtSubmask_Dir;
+ private System.Windows.Forms.Label lblGateway_Dir;
+ private System.Windows.Forms.Label lblSubmask_Dir;
+ private System.Windows.Forms.TextBox txtGateway_Dir;
+ private System.Windows.Forms.CheckBox chbConectado_Mov;
+ private System.Windows.Forms.CheckBox chbConectado_Dir;
}
}
\ No newline at end of file
diff --git a/AgroBase/AgroBase/Forms/frmEthernet.cs b/AgroBase/AgroBase/Forms/frmEthernet.cs
index 06a82374e..b0c7f7a98 100644
--- a/AgroBase/AgroBase/Forms/frmEthernet.cs
+++ b/AgroBase/AgroBase/Forms/frmEthernet.cs
@@ -1,4 +1,6 @@
-using System;
+using AgroBase.Models;
+using AgroBase.Services;
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -12,6 +14,9 @@ namespace AgroBase.Forms
{
public partial class frmEthernet : Form
{
+ private string _Interface = "";
+ private bool _VarreduraEmAndamento = false;
+
public frmEthernet()
{
InitializeComponent();
@@ -24,11 +29,23 @@ namespace AgroBase.Forms
if (interfaces.Any(x => x.Contains("Ativa")))
cmbInterface.SelectedIndex = interfaces.IndexOf(interfaces.First(x => x.Contains("Ativa")));
+ }
- txtGateway.Text = EthernetService.ObterIpGateway();
- txtIpAtual.Text = EthernetService.ObterIpAtual();
- txtSubmask.Text = EthernetService.ObterSubnetMaskAtual();
- chbIpFixo.Checked = EthernetService.ObterTipoConfiguracaoIP().Contains("Fixo");
+ private void PreencherDados()
+ {
+ txtGateway.Text = EthernetService.ObterIpGateway(_Interface);
+ txtIpAtual.Text = EthernetService.ObterIpAtual(_Interface);
+ txtSubmask.Text = EthernetService.ObterSubnetMaskAtual(_Interface);
+ chbIpFixo.Checked = EthernetService.ObterTipoConfiguracaoIP(_Interface).Contains("Fixo");
+
+ if (!string.IsNullOrEmpty(txtIpAtual.Text) && !_VarreduraEmAndamento)
+ {
+ var ip = txtIpAtual.Text.Split('.');
+ if (ip.Length > 2)
+ {
+ txtFaixaIP.Text = $"{ip[0]}.{ip[1]}.{ip[2]}";
+ }
+ }
}
private void btnDefinirIp_Click(object sender, EventArgs e)
@@ -40,13 +57,12 @@ namespace AgroBase.Forms
// Aqui substituímos "Ethernet" pelo nome correto da interface que o PC está usando
if (chbIpFixo.Checked)
{
- EthernetService.DefinirIpFixo(cmbInterface.Text, ipNovo, subnetMask, gateway);
+ EthernetService.DefinirIpFixo(_Interface, ipNovo, subnetMask, gateway);
}
else
{
- EthernetService.DefinirIpDinamico(cmbInterface.Text);
+ EthernetService.DefinirIpDinamico(_Interface);
}
- MessageBox.Show("Configuração de IP atualizada.");
}
private void chbIpFixo_CheckedChanged(object sender, EventArgs e)
@@ -55,5 +71,238 @@ namespace AgroBase.Forms
txtIpAtual.Enabled = chbIpFixo.Checked;
txtSubmask.Enabled = chbIpFixo.Checked;
}
+
+ private void cmbInterface_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ _Interface = cmbInterface.Text.Split('(')[0].Trim();
+ PreencherDados();
+ }
+
+ private async void btnIniciarVarredura_Click(object sender, EventArgs e)
+ {
+ if (btnIniciarVarredura.Text.Contains("Iniciar"))
+ {
+ btnIniciarVarredura.Text = "Parar Varredura";
+ if (await IniciarVarreduraAsync())
+ {
+ btnIniciarVarredura.Text = "Iniciar Varredura";
+ MessageBox.Show($"Verificação concluída com {tvwEncontrados.Nodes.Count} endereços encontrados!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ }
+ else
+ {
+ _VarreduraEmAndamento = false;
+ btnIniciarVarredura.Text = "Iniciar Varredura";
+ MessageBox.Show($"Verificação encerrada com {tvwEncontrados.Nodes.Count} endereços encontrados!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ }
+
+ private async Task IniciarVarreduraAsync()
+ {
+ string faixaIP = txtFaixaIP.Text.Trim(); // Ex: "192.168.0"
+ if (string.IsNullOrWhiteSpace(faixaIP))
+ {
+ MessageBox.Show("Insira uma faixa de IP válida.");
+ return false;
+ }
+
+ _VarreduraEmAndamento = true;
+
+ tvwEscaneados.Nodes.Clear();
+ tvwEncontrados.Nodes.Clear();
+
+ // Escaneia de 1 a 254 na faixa fornecida
+ for (int i = 1; i <= 254; i++)
+ {
+ if (!_VarreduraEmAndamento)
+ {
+ break;
+ }
+
+ string ip = $"{faixaIP}.{i}";
+
+ // Atualiza o TreeView com o IP que está sendo escaneado
+ TreeNode nodeEscaneado = new TreeNode(ip);
+ TreeNode nodeEncontrado = new TreeNode(ip);
+
+ bool isAlive = await EthernetService.PingAsync(ip);
+
+ if (isAlive)
+ {
+ nodeEscaneado.ForeColor = Color.Green;
+ // Atualiza o TreeView dos dispositivos encontrados
+ tvwEncontrados.Nodes.Add(nodeEncontrado);
+ }
+ else
+ {
+ nodeEscaneado.ForeColor = Color.Red;
+ }
+
+ tvwEscaneados.Nodes.Add(nodeEscaneado);
+ lblEscaneados.Text = $"Endereços escaneados {(i + 1)}";
+ }
+
+ _VarreduraEmAndamento = false;
+
+ AtualizarIPsEncontrados();
+
+ return tvwEncontrados.Nodes.Count == 254;
+ }
+
+ private void AtualizarIPsEncontrados()
+ {
+ cmbIP_Mov.Items.Clear();
+ cmbIP_Dir.Items.Clear();
+
+ foreach (TreeNode node in tvwEncontrados.Nodes)
+ {
+ cmbIP_Mov.Items.Add(node.Text);
+ cmbIP_Dir.Items.Add(node.Text);
+ }
+
+ gpbMov.Enabled = cmbIP_Mov.Items.Count > 0;
+ gpbDir.Enabled = cmbIP_Dir.Items.Count > 0;
+
+ if (tvwEncontrados.Nodes.Count > 0)
+ {
+ cmbIP_Mov.SelectedIndex = 0;
+ cmbIP_Dir.SelectedIndex = 0;
+ }
+ }
+
+ private async void btnVerificarAlteracoes_Click(object sender, EventArgs e)
+ {
+ if (btnVerificarAlteracoes.Text.Contains("Verificar"))
+ {
+ if (tvwEncontrados.Nodes.Count > 0)
+ {
+ if (MessageBox.Show("Desconecte o dispositivo que deseja identificar da rede e então pressione OK para verificar", "Confirmação", MessageBoxButtons.OK, MessageBoxIcon.Question) == DialogResult.OK)
+ {
+ btnVerificarAlteracoes.Text = "Cancelar Verificação";
+ if (await IniciarVarreduraAlteracoesAsync())
+ {
+ btnVerificarAlteracoes.Text = "Verificar Alterações";
+ MessageBox.Show($"Verificação concluída com {tvwAlterados.Nodes.Count} endereços alterados!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ }
+ }
+ }
+ else
+ {
+ btnVerificarAlteracoes.Text = "Verificar Alterações";
+ _VarreduraEmAndamento = false;
+ MessageBox.Show($"Verificação encerrada com {tvwAlterados.Nodes.Count} endereços alterados!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ }
+
+ private async Task IniciarVarreduraAlteracoesAsync()
+ {
+ _VarreduraEmAndamento = true;
+
+ tvwAlterados.Nodes.Clear();
+
+ int i = 0;
+ foreach (TreeNode node in tvwEncontrados.Nodes)
+ {
+ if (!_VarreduraEmAndamento)
+ {
+ break;
+ }
+
+ string ip = node.Text;
+
+ bool isAlive = await EthernetService.PingAsync(ip);
+
+ if (!isAlive)
+ {
+ tvwAlterados.Nodes.Add(ip);
+ }
+ i++;
+ }
+
+ _VarreduraEmAndamento = false;
+
+ return tvwEncontrados.Nodes.Count == i;
+ }
+
+ private async void cmbIP_Disp_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ ComboBox cmb = ((ComboBox)sender);
+ string name = cmb.Name.Replace("cmbIP_", "");
+ GroupBox gpb = FuncoesGlobais.FindControlRecursive(this, "gpb" + name);
+ CheckBox chb = FuncoesGlobais.FindControlRecursive(gpb, "chbConectado_" + name);
+ TextBox _txtGateway = FuncoesGlobais.FindControlRecursive(gpb, "txtGateway_" + name);
+ TextBox _txtSubmask = FuncoesGlobais.FindControlRecursive(gpb, "txtSubmask_" + name);
+ TextBox _txtIP = FuncoesGlobais.FindControlRecursive(gpb, "txtIP_" + name);
+ Button _btn = FuncoesGlobais.FindControlRecursive