Erste Funktionierende Version die Netzwerke einstellen kann
This commit is contained in:
@@ -38,9 +38,18 @@ namespace NetMonitorClient
|
||||
this.sc.setNetworkAuto(adapter);
|
||||
else
|
||||
{
|
||||
this.sc.setNetworkIp(ip, subnet, gateway);
|
||||
this.sc.setNetworkDNS(dns);
|
||||
this.sc.setNetworkWINS(wins);
|
||||
if (ip == "auto")
|
||||
this.sc.setNetworkIpAuto(adapter);
|
||||
else
|
||||
this.sc.setNetworkIp(ip, subnet, gateway, adapter);
|
||||
if(dns == "auto")
|
||||
this.sc.setNetworkDnsAuto(adapter);
|
||||
else
|
||||
this.sc.setNetworkDNS(dns, adapter);
|
||||
if(wins == "auto")
|
||||
this.sc.setNetworkWinsAuto(adapter);
|
||||
else
|
||||
this.sc.setNetworkWINS(wins, adapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,31 +24,107 @@ namespace NetMonitorClient
|
||||
this.rep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 34523);
|
||||
}
|
||||
|
||||
internal void setNetworkAuto(string networkcard)
|
||||
internal void setNetworkAuto(string adapter)
|
||||
{
|
||||
if (networkcard == null)
|
||||
if (adapter == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Adapter ist not Set!");
|
||||
return;
|
||||
}
|
||||
byte[] data = Encoding.UTF8.GetBytes("NET AUTO "+networkcard);
|
||||
byte[] data = Encoding.UTF8.GetBytes("NET AUTO "+adapter);
|
||||
this.client.Send(data, data.Length, this.rep);
|
||||
//throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal void setNetworkIp(string ip, string subnet, string gateway)
|
||||
internal void setNetworkIp(string ip, string subnet, string gateway, string adapter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (ip == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("IP address not Set!");
|
||||
return;
|
||||
}
|
||||
if (subnet == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Subnet address not Set!");
|
||||
return;
|
||||
}
|
||||
if (gateway == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Gateway address not Set!");
|
||||
return;
|
||||
}
|
||||
if (adapter == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Adapter ist not Set!");
|
||||
return;
|
||||
}
|
||||
byte[] data = Encoding.UTF8.GetBytes("NET IP " + ip + " " + subnet + " " + gateway + " " + adapter);
|
||||
this.client.Send(data, data.Length, this.rep);
|
||||
}
|
||||
|
||||
internal void setNetworkDNS(string dns)
|
||||
internal void setNetworkDNS(string dns, string adapter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (dns == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("DNS address not Set!");
|
||||
return;
|
||||
}
|
||||
if (adapter == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Adapter ist not Set!");
|
||||
return;
|
||||
}
|
||||
byte[] data = Encoding.UTF8.GetBytes("NET DNS " + dns + " " + adapter);
|
||||
this.client.Send(data, data.Length, this.rep);
|
||||
}
|
||||
|
||||
internal void setNetworkWINS(string wins)
|
||||
internal void setNetworkWINS(string wins, string adapter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (wins == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("WINS address not Set!");
|
||||
return;
|
||||
}
|
||||
if (adapter == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Adapter ist not Set!");
|
||||
return;
|
||||
}
|
||||
byte[] data = Encoding.UTF8.GetBytes("NET WINS " + wins + " " + adapter);
|
||||
this.client.Send(data, data.Length, this.rep);
|
||||
}
|
||||
|
||||
internal void setNetworkIpAuto(string adapter)
|
||||
{
|
||||
if (adapter == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Adapter ist not Set!");
|
||||
return;
|
||||
}
|
||||
byte[] data = Encoding.UTF8.GetBytes("NET IP AUTO "+adapter);
|
||||
this.client.Send(data, data.Length, this.rep);
|
||||
}
|
||||
|
||||
|
||||
internal void setNetworkDnsAuto(string adapter)
|
||||
{
|
||||
if (adapter == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Adapter ist not Set!");
|
||||
return;
|
||||
}
|
||||
byte[] data = Encoding.UTF8.GetBytes("NET DNS AUTO " + adapter);
|
||||
this.client.Send(data, data.Length, this.rep);
|
||||
}
|
||||
|
||||
internal void setNetworkWinsAuto(string adapter)
|
||||
{
|
||||
if (adapter == null)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Adapter ist not Set!");
|
||||
return;
|
||||
}
|
||||
byte[] data = Encoding.UTF8.GetBytes("NET WINS AUTO " + adapter);
|
||||
this.client.Send(data, data.Length, this.rep);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user