Server hinzugefügt; Auslesen des Menüs und der Ip adressen

This commit is contained in:
2010-04-21 11:34:01 +00:00
parent 27b6c5d466
commit 26dbe5cc52
11 changed files with 251 additions and 38 deletions
-4
View File
@@ -48,8 +48,6 @@
this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.trayMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.trayMenuNetzwerk = new System.Windows.Forms.ToolStripMenuItem();
this.homeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fhgToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.trayMenu.SuspendLayout();
@@ -209,8 +207,6 @@
private System.Windows.Forms.NotifyIcon trayIcon;
private System.Windows.Forms.ContextMenuStrip trayMenu;
private System.Windows.Forms.ToolStripMenuItem trayMenuNetzwerk;
private System.Windows.Forms.ToolStripMenuItem homeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fhgToolStripMenuItem;
private InIReader networkini;
}
}
+16 -8
View File
@@ -25,16 +25,24 @@ namespace NetMonitorCliend
this.WindowState = System.Windows.Forms.FormWindowState.Normal;
}
private void homeToolStripMenuItem_Click(object sender, EventArgs e)
private void TrayMenuNet_Click(object sender, EventArgs e)
{
this.sc.setNetworkAuto();
}
ToolStripMenuItem Item = (ToolStripMenuItem)sender;
String ip = networkini.getValue(Item.Name, "Ip");
String subnet = networkini.getValue(Item.Name, "Subnet");
String gateway = networkini.getValue(Item.Name, "Gateway");
String dns = networkini.getValue(Item.Name, "Dns");
String wins = networkini.getValue(Item.Name, "Wins");
if (ip == "auto" && dns == "auto" && wins == "auto")
this.sc.setNetworkAuto();
else
{
this.sc.setNetworkIp(ip, subnet, gateway);
this.sc.setNetworkDNS(dns);
this.sc.setNetworkWINS(wins);
}
private void fhgToolStripMenuItem_Click(object sender, EventArgs e)
{
this.sc.setNetworkIp("129.26.164.16","255.255.248.0","129.26.160.1");
this.sc.setNetworkDNS("129.26.165.177");
this.sc.setNetworkWINS("129.26.165.167");
}
}
}
+2 -3
View File
@@ -25,7 +25,6 @@ namespace NetMonitorCliend
this.trayMenuNetzwerk.Size = new System.Drawing.Size(152, 22);
this.trayMenuNetzwerk.Text = "Netzwerk";
ArrayList networks = networkini.getSections();
ToolStripItem[] tsi = new ToolStripItem[networks.Count];
@@ -33,10 +32,10 @@ namespace NetMonitorCliend
foreach (String net in networks)
{
ToolStripMenuItem TrayItemNet = new ToolStripMenuItem();
TrayItemNet.Name = networkini.getValue(net, "Name") + "ToolStripMenuItem";
TrayItemNet.Name = net;
TrayItemNet.Size = new System.Drawing.Size(152, 22);
TrayItemNet.Text = networkini.getValue(net, "Name");
TrayItemNet.Click += new System.EventHandler(this.homeToolStripMenuItem_Click);
TrayItemNet.Click += new System.EventHandler(this.TrayMenuNet_Click);
tsi[i++] = TrayItemNet;
}
+3 -3
View File
@@ -1,5 +1,5 @@
[network1]
Name=Home
[network2]
Name=FHG
Ip=auto
Dns=auto
Wins=auto