Komunikation vom Server to Client gefixt; Icons gefixt

This commit is contained in:
2010-06-02 07:49:33 +00:00
parent afcd1b62d6
commit eb90eb773d
15 changed files with 114 additions and 154 deletions
+2 -9
View File
@@ -29,7 +29,6 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Netzmonitor));
this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
@@ -49,13 +48,10 @@
this.trayMenuNetzwerk = new System.Windows.Forms.ToolStripMenuItem(); this.trayMenuNetzwerk = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// menuStrip1 // menuStrip1
// //
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem1,
this.dienstToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(284, 24); this.menuStrip1.Size = new System.Drawing.Size(284, 24);
@@ -143,8 +139,6 @@
// //
// statusStrip1 // statusStrip1
// //
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1});
this.statusStrip1.Location = new System.Drawing.Point(0, 240); this.statusStrip1.Location = new System.Drawing.Point(0, 240);
this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(284, 22); this.statusStrip1.Size = new System.Drawing.Size(284, 22);
@@ -160,8 +154,7 @@
// trayIcon // trayIcon
// //
this.trayIcon.ContextMenuStrip = this.trayMenu; this.trayIcon.ContextMenuStrip = this.trayMenu;
this.trayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("trayIcon.Icon"))); this.trayIcon.Text = "Netzwerk Einstellungstool";
this.trayIcon.Text = "notifyIcon1";
this.trayIcon.Visible = true; this.trayIcon.Visible = true;
this.trayIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.trayIcon_MouseDoubleClick); this.trayIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.trayIcon_MouseDoubleClick);
// //
+24 -12
View File
@@ -27,6 +27,7 @@ namespace NetMonitorClient
private void TrayMenuNet_Click(object sender, EventArgs e) private void TrayMenuNet_Click(object sender, EventArgs e)
{ {
ToolStripMenuItem Item = (ToolStripMenuItem)sender; ToolStripMenuItem Item = (ToolStripMenuItem)sender;
String name = networkini.getValue(Item.Name, "Name");
String ip = networkini.getValue(Item.Name, "Ip"); String ip = networkini.getValue(Item.Name, "Ip");
String subnet = networkini.getValue(Item.Name, "Subnet"); String subnet = networkini.getValue(Item.Name, "Subnet");
String gateway = networkini.getValue(Item.Name, "Gateway"); String gateway = networkini.getValue(Item.Name, "Gateway");
@@ -34,30 +35,41 @@ namespace NetMonitorClient
String wins = networkini.getValue(Item.Name, "Wins"); String wins = networkini.getValue(Item.Name, "Wins");
String adapter = networkini.getValue(Item.Name, "Adapter"); String adapter = networkini.getValue(Item.Name, "Adapter");
String ret = "";
if (ip == "auto" && dns == "auto" && wins == "auto") if (ip == "auto" && dns == "auto" && wins == "auto")
{ {
if (this.sc.setNetworkAuto(adapter)) this.showPopup(this.sc.setNetworkAuto(adapter),name,"Netzwerk auf Auto");
ret = Item.Name+";Netzwerk auf Auto gesetzt";
} }
else else
{ {
if (ip == "auto") if (ip == "auto")
this.sc.setNetworkIpAuto(adapter); this.showPopup(this.sc.setNetworkIpAuto(adapter),name,"Ip auf Auto");
else else
this.sc.setNetworkIp(ip, subnet, gateway, adapter); this.showPopup(this.sc.setNetworkIp(ip, subnet, gateway, adapter),name,"Ip: "+ip+";Subnet: "+subnet+";Gateway: "+gateway);
if(dns == "auto") if(dns == "auto")
this.sc.setNetworkDnsAuto(adapter); this.showPopup(this.sc.setNetworkDnsAuto(adapter),name,"Dns auf Auto");
else else
this.sc.setNetworkDNS(dns, adapter); this.showPopup(this.sc.setNetworkDNS(dns, adapter),name,"Dns: "+dns);
if(wins == "auto") if(wins == "auto")
this.sc.setNetworkWinsAuto(adapter); this.showPopup(this.sc.setNetworkWinsAuto(adapter),name,"Wins auf Auto");
else else
this.sc.setNetworkWINS(wins, adapter); this.showPopup(this.sc.setNetworkWINS(wins, adapter),name,"Wins: "+wins);
} }
this.trayIcon.BalloonTipIcon = ToolTipIcon.Info; }
this.trayIcon.BalloonTipTitle = ret.Split(';')[0];
this.trayIcon.BalloonTipText = ret.Split(';')[1]; private void showPopup(bool p, string titel, string text)
{
this.trayIcon.BalloonTipTitle = titel;
if (p)
{
this.trayIcon.BalloonTipIcon = ToolTipIcon.Info;
this.trayIcon.BalloonTipText = text + " gesetzt";
}
else
{
this.trayIcon.BalloonTipIcon = ToolTipIcon.Error;
this.trayIcon.BalloonTipText = text + " nicht gesetzt";
}
this.trayIcon.ShowBalloonTip(1000);
} }
} }
} }
+1 -79
View File
@@ -117,9 +117,6 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="serviceController1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>167, 17</value> <value>167, 17</value>
</metadata> </metadata>
@@ -127,84 +124,9 @@
<value>282, 17</value> <value>282, 17</value>
</metadata> </metadata>
<metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>511, 20</value> <value>22, 19</value>
</metadata> </metadata>
<metadata name="trayMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="trayMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>373, 17</value> <value>373, 17</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="trayIcon.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAIAEBAAAAAAAABoAwAAJgAAACAgAAAAAAAAqAwAAI4DAAAoAAAAEAAAACAAAAABABgAAAAAAEAD
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALzU0Q2JbPD09AAAAAAAAAAAAA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AAAAAAAA
AAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAwMOGRgDBQUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////8AAAAAAA////8AAAD///8AAAD///8AAAD/
//8AAAD///////////////8AAAD///8AAAAAAAD///8AAAD///////8AAAD///////////////8AAAAA
AA8AAA////8AAAD///8AAA////8AAAD///8AAAD///8AAAD///8AAAD///8AAAD///8AAAAAAAD///8A
AAAAAAD///8AAAD///8AAAAAAAD///8AAAD///8AAAD///8AAA8AAA////////8AAAAAAA//////////
//8AAAD///8AAAD///8AAAD///8AAAD///////8AAAD///////8AAAD///8AAAD///////8AAAD///8A
AAD///8AAAD///8AAA8AAA////8AAAD///8AAA////8AAAD///8AAAD///8AAAD///8AAAD///8AAAD/
//8AAAAAAAD///8AAAAAAAD///8AAAD///8AAAAAAAD///8AAAD///8AAAD///8AAA8AAA////////8A
AAAAAA////////8AAAD///////////////////////8AAAD///////8AAAD///////8AAAD///8AAAD/
//////8AAAD///8AAAD///////8AAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAD/4f///8B/+f+AH/H/AAPj/gAAR/4AAAP8AAAB/AAAAfgAAAPwAAAD4AAAA+AAAAfAAAAPgAAAH4AA
AD8AAAB/AAAA/wAAAf8AAAP/AAAAAAAAAACAAAAAgAAAAMOAMAD/4HAAAAAAAQAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAQ==
</value>
</data>
</root> </root>
+6
View File
@@ -124,6 +124,12 @@
<Install>true</Install> <Install>true</Install>
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Properties\icon_no.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\icon_ok.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
+1
View File
@@ -40,6 +40,7 @@ namespace NetMonitorClient
tsi[i++] = TrayItemNet; tsi[i++] = TrayItemNet;
} }
this.trayMenuNetzwerk.DropDownItems.AddRange(tsi); this.trayMenuNetzwerk.DropDownItems.AddRange(tsi);
this.trayIcon.Icon = Properties.Resources.icon_ok;
} }
} }
+14
View File
@@ -59,5 +59,19 @@ namespace NetMonitorClient.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
internal static System.Drawing.Icon icon_no {
get {
object obj = ResourceManager.GetObject("icon_no", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
internal static System.Drawing.Icon icon_ok {
get {
object obj = ResourceManager.GetObject("icon_ok", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
} }
} }
+13 -3
View File
@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
@@ -68,9 +69,10 @@
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
@@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
@@ -114,4 +117,11 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="icon_no" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>icon_no.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon_ok" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>icon_ok.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

+22 -20
View File
@@ -10,10 +10,10 @@ namespace NetMonitorClient
{ {
class ServiceControl class ServiceControl
{ {
private UdpClient client; private UdpClient net_send;
private IPEndPoint rep; //remoteEndPoint private IPEndPoint net_send_port;
private UdpClient answ = new UdpClient(34524); private UdpClient net_gets;
private IPEndPoint iep = new IPEndPoint(IPAddress.Loopback, 0); private IPEndPoint net_gets_port;
public ServiceControl(string name) public ServiceControl(string name)
{ {
ServiceController sc = new ServiceController(); ServiceController sc = new ServiceController();
@@ -22,8 +22,10 @@ namespace NetMonitorClient
//{ //{
// sc.Start(); // sc.Start();
//} //}
this.client = new UdpClient(); this.net_send = new UdpClient();
this.rep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 34523); this.net_send_port = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 34523);
this.net_gets = new UdpClient(34524);
this.net_gets_port = new IPEndPoint(IPAddress.Loopback, 0);
} }
internal bool setNetworkAuto(string adapter) internal bool setNetworkAuto(string adapter)
@@ -34,8 +36,8 @@ namespace NetMonitorClient
return false; return false;
} }
byte[] data = Encoding.UTF8.GetBytes("NET AUTO "+adapter); byte[] data = Encoding.UTF8.GetBytes("NET AUTO "+adapter);
this.client.Send(data, data.Length, this.rep); this.net_send.Send(data, data.Length, this.net_send_port);
return Boolean.Parse(Encoding.UTF8.GetString(client.Receive(ref iep))); return Boolean.Parse(Encoding.UTF8.GetString(net_gets.Receive(ref net_gets_port)));
} }
internal bool setNetworkIp(string ip, string subnet, string gateway, string adapter) internal bool setNetworkIp(string ip, string subnet, string gateway, string adapter)
@@ -61,8 +63,8 @@ namespace NetMonitorClient
return false; return false;
} }
byte[] data = Encoding.UTF8.GetBytes("NET IP " + ip + " " + subnet + " " + gateway + " " + adapter); byte[] data = Encoding.UTF8.GetBytes("NET IP " + ip + " " + subnet + " " + gateway + " " + adapter);
this.client.Send(data, data.Length, this.rep); this.net_send.Send(data, data.Length, this.net_send_port);
return Boolean.Parse(Encoding.UTF8.GetString(client.Receive(ref iep))); return Boolean.Parse(Encoding.UTF8.GetString(net_gets.Receive(ref net_gets_port)));
} }
internal bool setNetworkDNS(string dns, string adapter) internal bool setNetworkDNS(string dns, string adapter)
@@ -78,8 +80,8 @@ namespace NetMonitorClient
return false; return false;
} }
byte[] data = Encoding.UTF8.GetBytes("NET DNS " + dns + " " + adapter); byte[] data = Encoding.UTF8.GetBytes("NET DNS " + dns + " " + adapter);
this.client.Send(data, data.Length, this.rep); this.net_send.Send(data, data.Length, this.net_send_port);
return Boolean.Parse(Encoding.UTF8.GetString(client.Receive(ref iep))); return Boolean.Parse(Encoding.UTF8.GetString(net_gets.Receive(ref net_gets_port)));
} }
internal bool setNetworkWINS(string wins, string adapter) internal bool setNetworkWINS(string wins, string adapter)
@@ -95,8 +97,8 @@ namespace NetMonitorClient
return false; return false;
} }
byte[] data = Encoding.UTF8.GetBytes("NET WINS " + wins + " " + adapter); byte[] data = Encoding.UTF8.GetBytes("NET WINS " + wins + " " + adapter);
this.client.Send(data, data.Length, this.rep); this.net_send.Send(data, data.Length, this.net_send_port);
return Boolean.Parse(Encoding.UTF8.GetString(client.Receive(ref iep))); return Boolean.Parse(Encoding.UTF8.GetString(net_gets.Receive(ref net_gets_port)));
} }
internal bool setNetworkIpAuto(string adapter) internal bool setNetworkIpAuto(string adapter)
@@ -107,8 +109,8 @@ namespace NetMonitorClient
return false; return false;
} }
byte[] data = Encoding.UTF8.GetBytes("NET IP AUTO "+adapter); byte[] data = Encoding.UTF8.GetBytes("NET IP AUTO "+adapter);
this.client.Send(data, data.Length, this.rep); this.net_send.Send(data, data.Length, this.net_send_port);
return Boolean.Parse(Encoding.UTF8.GetString(client.Receive(ref iep))); return Boolean.Parse(Encoding.UTF8.GetString(net_gets.Receive(ref net_gets_port)));
} }
@@ -120,8 +122,8 @@ namespace NetMonitorClient
return false; return false;
} }
byte[] data = Encoding.UTF8.GetBytes("NET DNS AUTO " + adapter); byte[] data = Encoding.UTF8.GetBytes("NET DNS AUTO " + adapter);
this.client.Send(data, data.Length, this.rep); this.net_send.Send(data, data.Length, this.net_send_port);
return Boolean.Parse(Encoding.UTF8.GetString(client.Receive(ref iep))); return Boolean.Parse(Encoding.UTF8.GetString(net_gets.Receive(ref net_gets_port)));
} }
internal bool setNetworkWinsAuto(string adapter) internal bool setNetworkWinsAuto(string adapter)
@@ -132,8 +134,8 @@ namespace NetMonitorClient
return false; return false;
} }
byte[] data = Encoding.UTF8.GetBytes("NET WINS AUTO " + adapter); byte[] data = Encoding.UTF8.GetBytes("NET WINS AUTO " + adapter);
this.client.Send(data, data.Length, this.rep); this.net_send.Send(data, data.Length, this.net_send_port);
return Boolean.Parse(Encoding.UTF8.GetString(client.Receive(ref iep))); return Boolean.Parse(Encoding.UTF8.GetString(net_gets.Receive(ref net_gets_port)));
} }
} }
} }
+21 -21
View File
@@ -8,6 +8,27 @@ using System.ComponentModel;
namespace NetMonitorServer namespace NetMonitorServer
{ {
[RunInstaller(true)]
public class TestWinInstaller : Installer
{
private ServiceInstaller m_ThisService;
private ServiceProcessInstaller m_ThisServiceProcess;
public TestWinInstaller()
{
m_ThisService = new ServiceInstaller();
m_ThisServiceProcess = new ServiceProcessInstaller();
m_ThisServiceProcess.Account = ServiceAccount.LocalSystem;
m_ThisService.ServiceName = "NetMonitorServer";
m_ThisService.StartType = ServiceStartMode.Automatic;
m_ThisService.Description = "Teil von NetMonitor der die Systemnahen Befele ausführt";
m_ThisService.DisplayName = "Netzwerk Settings Tool";
Installers.Add(m_ThisService);
Installers.Add(m_ThisServiceProcess);
}
}
static class Program static class Program
{ {
/// <summary> /// <summary>
@@ -35,25 +56,4 @@ namespace NetMonitorServer
} }
} }
} }
[RunInstaller(true)]
public class TestWinInstaller : Installer
{
private ServiceInstaller m_ThisService;
private ServiceProcessInstaller m_ThisServiceProcess;
public TestWinInstaller()
{
m_ThisService = new ServiceInstaller();
m_ThisServiceProcess = new ServiceProcessInstaller();
m_ThisServiceProcess.Account = ServiceAccount.LocalSystem;
m_ThisService.ServiceName = "NetMonitorServer";
m_ThisService.StartType = ServiceStartMode.Automatic;
m_ThisService.Description = "Teil von NetMonitor der die Systemnahen Befele ausführt";
m_ThisService.DisplayName = "Netzwerk Settings Tool";
Installers.Add(m_ThisService);
Installers.Add(m_ThisServiceProcess);
}
}
} }
+4 -4
View File
@@ -23,16 +23,16 @@ namespace NetMonitorServer
} }
private static void overwatch() private static void overwatch()
{ {
UdpClient client = new UdpClient(34523); UdpClient net_gets = new UdpClient(34523);
IPEndPoint iep = new IPEndPoint(IPAddress.Loopback, 0); IPEndPoint net_gets_port = new IPEndPoint(IPAddress.Loopback, 0);
while (true) while (true)
{ {
if (Thread.CurrentThread.ThreadState == System.Threading.ThreadState.AbortRequested) if (Thread.CurrentThread.ThreadState == System.Threading.ThreadState.AbortRequested)
{ {
client.Close(); net_gets.Close();
break; break;
} }
byte[] data = client.Receive(ref iep); byte[] data = net_gets.Receive(ref net_gets_port);
string text = Encoding.UTF8.GetString(data); string text = Encoding.UTF8.GetString(data);
switchCommand(text); switchCommand(text);
} }
+6 -6
View File
@@ -10,8 +10,8 @@ namespace NetMonitorServer
{ {
class SetNetworks class SetNetworks
{ {
UdpClient sendanswer = new UdpClient(); UdpClient net_send = new UdpClient();
IPEndPoint rep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 34524); IPEndPoint net_send_port = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 34524);
public SetNetworks(string data) public SetNetworks(string data)
{ {
@@ -36,7 +36,7 @@ namespace NetMonitorServer
else else
ret = this.runProgramNetsh("interface ipv4 set winsservers \"" + par[3] + "\" static " + par[2]); ret = this.runProgramNetsh("interface ipv4 set winsservers \"" + par[3] + "\" static " + par[2]);
byte[] answ = Encoding.UTF8.GetBytes(ret.ToString()); byte[] answ = Encoding.UTF8.GetBytes(ret.ToString());
sendanswer.Send(answ, answ.Length, rep); net_send.Send(answ, answ.Length, net_send_port);
} }
private void setNetworkDns(string data) private void setNetworkDns(string data)
@@ -50,7 +50,7 @@ namespace NetMonitorServer
else else
ret = this.runProgramNetsh("interface ipv4 set dnsservers \"" + par[3] + "\" static " + par[2] + " primary"); ret = this.runProgramNetsh("interface ipv4 set dnsservers \"" + par[3] + "\" static " + par[2] + " primary");
byte[] answ = Encoding.UTF8.GetBytes(ret.ToString()); byte[] answ = Encoding.UTF8.GetBytes(ret.ToString());
sendanswer.Send(answ, answ.Length, rep); net_send.Send(answ, answ.Length, net_send_port);
} }
private void setNetworkIp(string data) private void setNetworkIp(string data)
@@ -64,7 +64,7 @@ namespace NetMonitorServer
else else
ret = this.runProgramNetsh("interface ipv4 set address \"" + par[5] + "\" static " + par[2] + " " + par[3] + " " + par[4]); ret = this.runProgramNetsh("interface ipv4 set address \"" + par[5] + "\" static " + par[2] + " " + par[3] + " " + par[4]);
byte[] answ = Encoding.UTF8.GetBytes(ret.ToString()); byte[] answ = Encoding.UTF8.GetBytes(ret.ToString());
sendanswer.Send(answ, answ.Length, rep); net_send.Send(answ, answ.Length, net_send_port);
} }
private void setNetworkAuto(string data) private void setNetworkAuto(string data)
@@ -79,7 +79,7 @@ namespace NetMonitorServer
answ = Encoding.UTF8.GetBytes(true.ToString()); answ = Encoding.UTF8.GetBytes(true.ToString());
else else
answ = Encoding.UTF8.GetBytes(false.ToString()); answ = Encoding.UTF8.GetBytes(false.ToString());
sendanswer.Send(answ, answ.Length, rep); net_send.Send(answ, answ.Length, net_send_port);
} }
private bool runProgramNetsh(string args) private bool runProgramNetsh(string args)