From 177a0c17c8ecf01694be05bf1529b7ee34ff385f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czy=C5=BC?= Date: Mon, 22 Mar 2021 12:35:31 +0100 Subject: [PATCH] 1.0.0 Release :tada: --- Server Manager/App.config | 24 ++ Server Manager/Form1.Designer.cs | 156 +++++----- Server Manager/Form1.cs | 267 ++++++++++-------- Server Manager/Form1.resx | 2 +- Server Manager/Form2.Designer.cs | 259 ++++++----------- Server Manager/Form2.cs | 80 +++--- Server Manager/License.txt | 9 - .../Properties/Settings.Designer.cs | 112 ++++---- Server Manager/Properties/Settings.settings | 33 +-- Server Manager/Server Manager.csproj | 14 +- Server Manager/packages.config | 4 +- 11 files changed, 440 insertions(+), 520 deletions(-) delete mode 100644 Server Manager/License.txt diff --git a/Server Manager/App.config b/Server Manager/App.config index e10b490..2355c04 100644 --- a/Server Manager/App.config +++ b/Server Manager/App.config @@ -2,6 +2,7 @@ +
@@ -9,6 +10,29 @@ + + + 192.168.0.250 + + + domowy + + + qaz + + + shutdown -s -t 0 + + + 60-32-B1-D8-C7-A0 + + + 192.168.0.255 + + + 9 + + 192.168.0.200 diff --git a/Server Manager/Form1.Designer.cs b/Server Manager/Form1.Designer.cs index a6262ce..2df121c 100644 --- a/Server Manager/Form1.Designer.cs +++ b/Server Manager/Form1.Designer.cs @@ -30,79 +30,66 @@ { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main)); - this.ping_button = new System.Windows.Forms.Button(); - this.power_on = new System.Windows.Forms.Button(); - this.power_off = new System.Windows.Forms.Button(); + this.Ping_Button = new System.Windows.Forms.Button(); + this.Power_ON = new System.Windows.Forms.Button(); + this.Power_OFF = new System.Windows.Forms.Button(); this.Ping_Stuff = new System.Windows.Forms.GroupBox(); - this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.Power = new System.Windows.Forms.GroupBox(); this.Explore_Settings = new System.Windows.Forms.GroupBox(); - this.settings = new System.Windows.Forms.Button(); - this.open_win_exporer = new System.Windows.Forms.Button(); - this.timer1 = new System.Windows.Forms.Timer(this.components); + this.Settings = new System.Windows.Forms.Button(); + this.Open_Win_Explorer = new System.Windows.Forms.Button(); + this.Auto_Ping = new System.Windows.Forms.Timer(this.components); this.Ping_Stuff.SuspendLayout(); this.Power.SuspendLayout(); this.Explore_Settings.SuspendLayout(); this.SuspendLayout(); // - // ping_button + // Ping_Button // - this.ping_button.Location = new System.Drawing.Point(6, 71); - this.ping_button.Name = "ping_button"; - this.ping_button.Size = new System.Drawing.Size(259, 25); - this.ping_button.TabIndex = 0; - this.ping_button.Text = "Check Status"; - this.ping_button.UseVisualStyleBackColor = true; - this.ping_button.Click += new System.EventHandler(this.Ping_button_Click); + this.Ping_Button.Location = new System.Drawing.Point(6, 36); + this.Ping_Button.Name = "Ping_Button"; + this.Ping_Button.Size = new System.Drawing.Size(259, 25); + this.Ping_Button.TabIndex = 0; + this.Ping_Button.Text = "Check Status"; + this.Ping_Button.UseVisualStyleBackColor = true; + this.Ping_Button.Click += new System.EventHandler(this.Ping_button_Click); // - // power_on + // Power_ON // - this.power_on.Enabled = false; - this.power_on.Location = new System.Drawing.Point(5, 19); - this.power_on.Name = "power_on"; - this.power_on.Size = new System.Drawing.Size(259, 25); - this.power_on.TabIndex = 1; - this.power_on.Text = "Power ON"; - this.power_on.UseVisualStyleBackColor = true; - this.power_on.Click += new System.EventHandler(this.Power_on_Click); + this.Power_ON.Enabled = false; + this.Power_ON.Location = new System.Drawing.Point(5, 19); + this.Power_ON.Name = "Power_ON"; + this.Power_ON.Size = new System.Drawing.Size(259, 25); + this.Power_ON.TabIndex = 1; + this.Power_ON.Text = "Power ON"; + this.Power_ON.UseVisualStyleBackColor = true; + this.Power_ON.Click += new System.EventHandler(this.Power_on_Click); // - // power_off + // Power_OFF // - this.power_off.Enabled = false; - this.power_off.Location = new System.Drawing.Point(5, 50); - this.power_off.Name = "power_off"; - this.power_off.Size = new System.Drawing.Size(259, 25); - this.power_off.TabIndex = 2; - this.power_off.Text = "Power OFF"; - this.power_off.UseVisualStyleBackColor = true; - this.power_off.Click += new System.EventHandler(this.Power_off_Click); + this.Power_OFF.Enabled = false; + this.Power_OFF.Location = new System.Drawing.Point(5, 50); + this.Power_OFF.Name = "Power_OFF"; + this.Power_OFF.Size = new System.Drawing.Size(259, 25); + this.Power_OFF.TabIndex = 2; + this.Power_OFF.Text = "Power OFF"; + this.Power_OFF.UseVisualStyleBackColor = true; + this.Power_OFF.Click += new System.EventHandler(this.Power_off_Click); // // Ping_Stuff // - this.Ping_Stuff.Controls.Add(this.label4); this.Ping_Stuff.Controls.Add(this.label3); - this.Ping_Stuff.Controls.Add(this.label2); this.Ping_Stuff.Controls.Add(this.label1); - this.Ping_Stuff.Controls.Add(this.ping_button); + this.Ping_Stuff.Controls.Add(this.Ping_Button); this.Ping_Stuff.Location = new System.Drawing.Point(12, 12); this.Ping_Stuff.Name = "Ping_Stuff"; - this.Ping_Stuff.Size = new System.Drawing.Size(271, 105); + this.Ping_Stuff.Size = new System.Drawing.Size(271, 74); this.Ping_Stuff.TabIndex = 3; this.Ping_Stuff.TabStop = false; this.Ping_Stuff.Text = "Server Status"; // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(194, 44); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(71, 13); - this.label4.TabIndex = 4; - this.label4.Text = "CHECKING..."; - // // label3 // this.label3.AutoSize = true; @@ -112,15 +99,6 @@ this.label3.TabIndex = 3; this.label3.Text = "CHECKING..."; // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(7, 44); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(123, 13); - this.label2.TabIndex = 2; - this.label2.Text = "Operating System Status"; - // // label1 // this.label1.AutoSize = true; @@ -132,9 +110,9 @@ // // Power // - this.Power.Controls.Add(this.power_on); - this.Power.Controls.Add(this.power_off); - this.Power.Location = new System.Drawing.Point(13, 124); + this.Power.Controls.Add(this.Power_ON); + this.Power.Controls.Add(this.Power_OFF); + this.Power.Location = new System.Drawing.Point(13, 92); this.Power.Name = "Power"; this.Power.Size = new System.Drawing.Size(270, 86); this.Power.TabIndex = 4; @@ -143,45 +121,45 @@ // // Explore_Settings // - this.Explore_Settings.Controls.Add(this.settings); - this.Explore_Settings.Controls.Add(this.open_win_exporer); - this.Explore_Settings.Location = new System.Drawing.Point(13, 217); + this.Explore_Settings.Controls.Add(this.Settings); + this.Explore_Settings.Controls.Add(this.Open_Win_Explorer); + this.Explore_Settings.Location = new System.Drawing.Point(13, 184); this.Explore_Settings.Name = "Explore_Settings"; this.Explore_Settings.Size = new System.Drawing.Size(270, 85); this.Explore_Settings.TabIndex = 5; this.Explore_Settings.TabStop = false; this.Explore_Settings.Text = "Explore and Settings"; // - // settings + // Settings // - this.settings.Location = new System.Drawing.Point(9, 49); - this.settings.Name = "settings"; - this.settings.Size = new System.Drawing.Size(255, 23); - this.settings.TabIndex = 1; - this.settings.Text = "Settings"; - this.settings.UseVisualStyleBackColor = true; - this.settings.Click += new System.EventHandler(this.Settings_Click); + this.Settings.Location = new System.Drawing.Point(9, 49); + this.Settings.Name = "Settings"; + this.Settings.Size = new System.Drawing.Size(255, 23); + this.Settings.TabIndex = 1; + this.Settings.Text = "Settings"; + this.Settings.UseVisualStyleBackColor = true; + this.Settings.Click += new System.EventHandler(this.Settings_Click); // - // open_win_exporer + // Open_Win_Explorer // - this.open_win_exporer.Location = new System.Drawing.Point(9, 20); - this.open_win_exporer.Name = "open_win_exporer"; - this.open_win_exporer.Size = new System.Drawing.Size(255, 23); - this.open_win_exporer.TabIndex = 0; - this.open_win_exporer.Text = "Open in Windows Explorer"; - this.open_win_exporer.UseVisualStyleBackColor = true; - this.open_win_exporer.Click += new System.EventHandler(this.Open_win_exporer_Click); + this.Open_Win_Explorer.Location = new System.Drawing.Point(9, 20); + this.Open_Win_Explorer.Name = "Open_Win_Explorer"; + this.Open_Win_Explorer.Size = new System.Drawing.Size(255, 23); + this.Open_Win_Explorer.TabIndex = 0; + this.Open_Win_Explorer.Text = "Open in Windows Explorer"; + this.Open_Win_Explorer.UseVisualStyleBackColor = true; + this.Open_Win_Explorer.Click += new System.EventHandler(this.Open_win_exporer_Click); // - // timer1 + // Auto_Ping // - this.timer1.Interval = 8000; - this.timer1.Tick += new System.EventHandler(this.Timer1_Tick); + this.Auto_Ping.Interval = 8000; + this.Auto_Ping.Tick += new System.EventHandler(this.Auto_Ping_Tick); // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(295, 314); + this.ClientSize = new System.Drawing.Size(295, 282); this.Controls.Add(this.Explore_Settings); this.Controls.Add(this.Power); this.Controls.Add(this.Ping_Stuff); @@ -202,19 +180,17 @@ #endregion - private System.Windows.Forms.Button ping_button; - private System.Windows.Forms.Button power_on; - private System.Windows.Forms.Button power_off; + private System.Windows.Forms.Button Ping_Button; + private System.Windows.Forms.Button Power_ON; + private System.Windows.Forms.Button Power_OFF; private System.Windows.Forms.GroupBox Ping_Stuff; - private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; private System.Windows.Forms.GroupBox Power; private System.Windows.Forms.GroupBox Explore_Settings; - private System.Windows.Forms.Button settings; - private System.Windows.Forms.Button open_win_exporer; - private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.Button Settings; + private System.Windows.Forms.Button Open_Win_Explorer; + private System.Windows.Forms.Timer Auto_Ping; } } diff --git a/Server Manager/Form1.cs b/Server Manager/Form1.cs index ee0a2ce..5c0764b 100644 --- a/Server Manager/Form1.cs +++ b/Server Manager/Form1.cs @@ -1,10 +1,13 @@ using System; using System.Drawing; -using System.Linq; using System.Windows.Forms; using System.Threading; using Renci.SshNet; -using Renci.SshNet.Common; +using System.Net; +using System.Net.Sockets; +using System.Globalization; +using System.Net.NetworkInformation; +using System.Text.RegularExpressions; namespace Server_Manager { @@ -23,12 +26,12 @@ namespace Server_Manager private void Open_win_exporer_Click(object sender, EventArgs e) { - var OSIP = Properties.Settings.Default.OSIP; + var IP = Properties.Settings.Default.IP; Thread exp = new Thread(() => { _ = System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo() { - FileName = "\\\\" + OSIP + "\\", + FileName = "\\\\" + IP + "\\", UseShellExecute = true, Verb = "open" }); @@ -36,183 +39,219 @@ namespace Server_Manager exp.Start(); } - private bool checkNetCardIP() + private bool Ping_IP() { - var NetCardIP = Properties.Settings.Default.NetCardIP; - - System.Net.NetworkInformation.Ping objping = new System.Net.NetworkInformation.Ping(); - if (objping.Send(NetCardIP, 1000).Status == System.Net.NetworkInformation.IPStatus.Success) - { - return true; - } - else - { - return false; - } - } - - private bool checkOSIP() - { - var OSIP = Properties.Settings.Default.OSIP; - - System.Net.NetworkInformation.Ping objping = new System.Net.NetworkInformation.Ping(); - if (objping.Send(OSIP, 1000).Status == System.Net.NetworkInformation.IPStatus.Success) - { - return true; - } - else - { - return false; - } + var IP = Properties.Settings.Default.IP; + Ping objping = new Ping(); + if (objping.Send(IP, 500).Status == IPStatus.Success) { return true; } else { return false; } } private void Main_Load(object sender, EventArgs e) { - // timer1.Start(); + Auto_Ping.Start(); Thread pingTest = new Thread(() => { - NetCardStatus = checkNetCardIP(); - OSStatus = checkOSIP(); - Action action = new Action(SetColorsofLabels); + Status = Ping_IP(); + Action action = new Action(Update_Labels); BeginInvoke(action); }); pingTest.Start(); } - bool NetCardStatus = false; - bool OSStatus = false; + bool Status = false; private void Ping_button_Click(object sender, EventArgs e) { Thread pingTest = new Thread(() => { - NetCardStatus = checkNetCardIP(); - OSStatus = checkOSIP(); - Action action = new Action(SetColorsofLabels); + Status = Ping_IP(); + Action action = new Action(Update_Labels); BeginInvoke(action); }); pingTest.Start(); - ping_button.Enabled = false; + Ping_Button.Enabled = false; label3.Text = "CHECKING..."; label3.ForeColor = Color.Black; - label4.Text = "CHECKING..."; - label4.ForeColor = Color.Black; } - private void SetColorsofLabels() + private void Update_Labels() { - if (NetCardStatus == true) + if (Status == true) { label3.Text = "ONLINE"; label3.ForeColor = Color.Green; + Power_ON.Enabled = false; + Power_OFF.Enabled = true; + Open_Win_Explorer.Enabled = true; } else { label3.Text = "OFFLINE"; label3.ForeColor = Color.Red; + Power_ON.Enabled = true; + Power_OFF.Enabled = false; + Open_Win_Explorer.Enabled = false; } - if (OSStatus == true) + Ping_Button.Enabled = true; + } + + private void Update_Labels_Auto() + { + if (Status == true) { - label4.Text = "ONLINE"; - label4.ForeColor = Color.Green; + if (Power_ON.Text == "Booting...") + { + Power_ON.Enabled = false; + Power_OFF.Enabled = true; + Open_Win_Explorer.Enabled = true; + } + label3.Text = "ONLINE"; + label3.ForeColor = Color.Green; } else { - label4.Text = "OFFLINE"; - label4.ForeColor = Color.Red; + if (Power_OFF.Text == "Shutting Down...") + { + Power_ON.Enabled = true; + Power_OFF.Enabled = false; + Open_Win_Explorer.Enabled = false; + } + label3.Text = "OFFLINE"; + label3.ForeColor = Color.Red; + } + } + + static long IPToInt(string addr) + { + return (long) (uint) IPAddress.NetworkToHostOrder( + (int) IPAddress.Parse(addr).Address + ); + } + + private static void WakeUp(string macAddress) + { + var IP = Properties.Settings.Default.BroadcastIP; + string[] Tmp_IP = IP.Split('.'); + Array.Reverse(Tmp_IP); + string Final_IP = string.Join(".", Tmp_IP); + var Hex_IP = IPToInt(Final_IP); + + int Port = int.Parse(Properties.Settings.Default.Port); + string Str_Port = Port.ToString("X"); + int Hex_Port = int.Parse(Str_Port , NumberStyles.HexNumber); + + MessageBox.Show(Hex_IP.ToString()); + + WOLClass client = new WOLClass(); + client.Connect(new IPAddress(Hex_IP), Hex_Port); + client.SetClientToBroadcastMode(); + + int counter = 0; + + byte[] bytes = new byte[1024]; + + for (int e = 0; e < 6; e++) + { + bytes[counter++] = 0xFF; } - if (label3.Text == "OFFLINE" && label4.Text == "OFFLINE") + for (int e = 0; e < 16; e++) { - power_on.Enabled = false; - power_off.Enabled = false; - open_win_exporer.Enabled = false; + int i = 0; + + for (int w = 0; w < 6; w++) + { + bytes[counter++] = byte.Parse(macAddress.Substring(i, 2), NumberStyles.HexNumber); + i += 2; + } } - else if (label3.Text == "ONLINE" && label4.Text == "OFFLINE") + + int returnedValue = client.Send(bytes, 1024); + } + + public class WOLClass : UdpClient + { + public WOLClass() + : base() { - power_on.Enabled = true; - power_off.Enabled = false; - open_win_exporer.Enabled = false; + } - else if (label3.Text == "ONLINE" && label4.Text == "ONLINE") + + public void SetClientToBroadcastMode() { - power_on.Enabled = false; - power_off.Enabled = true; - open_win_exporer.Enabled = true; + if (this.Active) + { + this.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 0); + } } - ping_button.Enabled = true; } private void Power_on_Click(object sender, EventArgs e) { - power_on.Enabled = false; - power_on.Text = "Booting..."; + var MAC = Regex.Replace(Properties.Settings.Default.MAC, @"[^0-9a-fA-F]+", ""); - var clientip = Properties.Settings.Default.NetCardIP; - var username = Properties.Settings.Default.NetCardUser; - var password = Properties.Settings.Default.NetCardPass; - var boot = Properties.Settings.Default.StartCmd; - - var authMethod = new KeyboardInteractiveAuthenticationMethod(username); - authMethod.AuthenticationPrompt += (sender2, d) => + if (MessageBox.Show("Are you sure?", "Power ON", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { - d.Prompts.Single().Response = password; - }; - - using (var client = new SshClient(clientip, username, authMethod.ToString())) + Power_ON.Enabled = false; + Power_ON.Text = "Booting..."; + WakeUp(MAC); + Power_ON.Text = "Power ON"; + } + else { - try - { - client.HostKeyReceived += delegate (object s, HostKeyEventArgs c) - { - c.CanTrust = true; - }; - client.Connect(); - client.RunCommand(boot).Execute(); - MessageBox.Show("Test"); - client.Disconnect(); - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), "Error! Unable to Power ON!", MessageBoxButtons.OK, MessageBoxIcon.Error); - client.Dispose(); - power_on.Text = "Power ON"; - power_on.Enabled = true; - } + Power_ON.Enabled = true; + Power_ON.Text = "Power ON"; } } private void Power_off_Click(object sender, EventArgs e) { - power_off.Enabled = false; - power_off.Text = "Shutting Down..."; - var clientip = Properties.Settings.Default.OSIP; - var username = Properties.Settings.Default.OSUser; - var password = Properties.Settings.Default.OSPass; - var shutdown = Properties.Settings.Default.ShutDwnCmd; - - using (var client = new SshClient(clientip, username, password)) + if (MessageBox.Show("Are you sure?", "Power OFF", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { - try + Power_OFF.Enabled = false; + Power_OFF.Text = "Shutting Down..."; + var IP = Properties.Settings.Default.IP; + var Username = Properties.Settings.Default.Username; + var Password = Properties.Settings.Default.Password; + var CMD = Properties.Settings.Default.ShutdownCMD; + + using (var client = new SshClient(IP, Username, Password)) { - client.Connect(); - client.RunCommand(shutdown); - client.Disconnect(); - } - catch - { - MessageBox.Show("Unable to Power OFF - Connection Refused", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - client.Dispose(); - power_off.Text = "Power OFF"; + try + { + client.Connect(); + client.RunCommand(CMD); + client.Disconnect(); + Power_OFF.Enabled = true; + Power_OFF.Text = "Power OFF"; + } + catch + { + MessageBox.Show("Unable to Power OFF - Connection Refused", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + client.Dispose(); + Power_OFF.Enabled = true; + Power_OFF.Text = "Power OFF"; + } } } + else + { + Power_OFF.Enabled = true; + Power_OFF.Text = "Power OFF"; + } } - private void Timer1_Tick(object sender, EventArgs e) + private void Auto_Ping_Tick(object sender, EventArgs e) { - ping_button.PerformClick(); + Thread pingTest = new Thread(() => + { + Status = Ping_IP(); + Action action = new Action(Update_Labels_Auto); + BeginInvoke(action); + }); + pingTest.Start(); } } } diff --git a/Server Manager/Form1.resx b/Server Manager/Form1.resx index acb96b0..9c6510c 100644 --- a/Server Manager/Form1.resx +++ b/Server Manager/Form1.resx @@ -117,7 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 diff --git a/Server Manager/Form2.Designer.cs b/Server Manager/Form2.Designer.cs index 1172a7a..455e69e 100644 --- a/Server Manager/Form2.Designer.cs +++ b/Server Manager/Form2.Designer.cs @@ -30,43 +30,35 @@ { this.button1 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); this.checkBox1 = new System.Windows.Forms.CheckBox(); - this.checkBox2 = new System.Windows.Forms.CheckBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); this.checkBox4 = new System.Windows.Forms.CheckBox(); this.textBox5 = new System.Windows.Forms.TextBox(); this.textBox6 = new System.Windows.Forms.TextBox(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.checkBox3 = new System.Windows.Forms.CheckBox(); - this.textBox4 = new System.Windows.Forms.TextBox(); - this.textBox3 = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); this.button2 = new System.Windows.Forms.Button(); this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.label9 = new System.Windows.Forms.Label(); + this.checkBox8 = new System.Windows.Forms.CheckBox(); + this.textBox9 = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); this.checkBox6 = new System.Windows.Forms.CheckBox(); this.checkBox5 = new System.Windows.Forms.CheckBox(); this.textBox8 = new System.Windows.Forms.TextBox(); this.textBox7 = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.textBox2 = new System.Windows.Forms.TextBox(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.groupBox3.SuspendLayout(); this.groupBox5.SuspendLayout(); this.SuspendLayout(); // // button1 // - this.button1.Location = new System.Drawing.Point(303, 327); + this.button1.Location = new System.Drawing.Point(303, 280); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 0; @@ -77,21 +69,12 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(6, 21); + this.label1.Location = new System.Drawing.Point(6, 22); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(85, 13); this.label1.TabIndex = 2; this.label1.Text = "Network Card IP"; // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(6, 48); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(35, 13); - this.label2.TabIndex = 3; - this.label2.Text = "OS IP"; - // // textBox1 // this.textBox1.Enabled = false; @@ -102,16 +85,6 @@ this.textBox1.TabIndex = 4; this.textBox1.Text = "0.0.0.0"; // - // textBox2 - // - this.textBox2.Enabled = false; - this.textBox2.Location = new System.Drawing.Point(154, 45); - this.textBox2.MaxLength = 50; - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(156, 20); - this.textBox2.TabIndex = 5; - this.textBox2.Text = "0.0.0.0"; - // // checkBox1 // this.checkBox1.AutoSize = true; @@ -123,62 +96,36 @@ this.checkBox1.UseVisualStyleBackColor = true; this.checkBox1.CheckedChanged += new System.EventHandler(this.CheckBox1_CheckedChanged); // - // checkBox2 - // - this.checkBox2.AutoSize = true; - this.checkBox2.Location = new System.Drawing.Point(316, 48); - this.checkBox2.Name = "checkBox2"; - this.checkBox2.Size = new System.Drawing.Size(44, 17); - this.checkBox2.TabIndex = 7; - this.checkBox2.Text = "Edit"; - this.checkBox2.UseVisualStyleBackColor = true; - this.checkBox2.CheckedChanged += new System.EventHandler(this.CheckBox2_CheckedChanged); - // // groupBox1 // - this.groupBox1.Controls.Add(this.label2); - this.groupBox1.Controls.Add(this.checkBox2); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.checkBox1); this.groupBox1.Controls.Add(this.textBox1); - this.groupBox1.Controls.Add(this.textBox2); this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(366, 80); + this.groupBox1.Size = new System.Drawing.Size(366, 49); this.groupBox1.TabIndex = 8; this.groupBox1.TabStop = false; this.groupBox1.Text = "IP Configuration"; // // groupBox2 // - this.groupBox2.Controls.Add(this.groupBox4); - this.groupBox2.Controls.Add(this.groupBox3); - this.groupBox2.Location = new System.Drawing.Point(12, 98); + this.groupBox2.Controls.Add(this.checkBox4); + this.groupBox2.Controls.Add(this.textBox5); + this.groupBox2.Controls.Add(this.label6); + this.groupBox2.Controls.Add(this.textBox6); + this.groupBox2.Controls.Add(this.label5); + this.groupBox2.Location = new System.Drawing.Point(12, 67); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(366, 136); + this.groupBox2.Size = new System.Drawing.Size(366, 75); this.groupBox2.TabIndex = 9; this.groupBox2.TabStop = false; this.groupBox2.Text = "Credentials"; - this.groupBox2.Enter += new System.EventHandler(this.GroupBox2_Enter); - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.checkBox4); - this.groupBox4.Controls.Add(this.textBox5); - this.groupBox4.Controls.Add(this.textBox6); - this.groupBox4.Controls.Add(this.label6); - this.groupBox4.Controls.Add(this.label5); - this.groupBox4.Location = new System.Drawing.Point(190, 20); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(170, 111); - this.groupBox4.TabIndex = 1; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "OS Credentials"; // // checkBox4 // this.checkBox4.AutoSize = true; - this.checkBox4.Location = new System.Drawing.Point(117, 20); + this.checkBox4.Location = new System.Drawing.Point(316, 22); this.checkBox4.Name = "checkBox4"; this.checkBox4.Size = new System.Drawing.Size(44, 17); this.checkBox4.TabIndex = 5; @@ -189,24 +136,24 @@ // textBox5 // this.textBox5.Enabled = false; - this.textBox5.Location = new System.Drawing.Point(6, 79); + this.textBox5.Location = new System.Drawing.Point(154, 46); this.textBox5.Name = "textBox5"; this.textBox5.PasswordChar = '*'; - this.textBox5.Size = new System.Drawing.Size(155, 20); + this.textBox5.Size = new System.Drawing.Size(156, 20); this.textBox5.TabIndex = 7; // // textBox6 // this.textBox6.Enabled = false; - this.textBox6.Location = new System.Drawing.Point(6, 38); + this.textBox6.Location = new System.Drawing.Point(154, 20); this.textBox6.Name = "textBox6"; - this.textBox6.Size = new System.Drawing.Size(155, 20); + this.textBox6.Size = new System.Drawing.Size(156, 20); this.textBox6.TabIndex = 6; // // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(3, 21); + this.label6.Location = new System.Drawing.Point(9, 23); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(55, 13); this.label6.TabIndex = 4; @@ -215,76 +162,15 @@ // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(3, 63); + this.label5.Location = new System.Drawing.Point(9, 49); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(53, 13); this.label5.TabIndex = 5; this.label5.Text = "Password"; // - // groupBox3 - // - this.groupBox3.Controls.Add(this.checkBox3); - this.groupBox3.Controls.Add(this.textBox4); - this.groupBox3.Controls.Add(this.textBox3); - this.groupBox3.Controls.Add(this.label4); - this.groupBox3.Controls.Add(this.label3); - this.groupBox3.Location = new System.Drawing.Point(6, 20); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(170, 110); - this.groupBox3.TabIndex = 0; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Network Card Credentials"; - // - // checkBox3 - // - this.checkBox3.AutoSize = true; - this.checkBox3.Location = new System.Drawing.Point(120, 20); - this.checkBox3.Name = "checkBox3"; - this.checkBox3.Size = new System.Drawing.Size(44, 17); - this.checkBox3.TabIndex = 4; - this.checkBox3.Text = "Edit"; - this.checkBox3.UseVisualStyleBackColor = true; - this.checkBox3.CheckedChanged += new System.EventHandler(this.CheckBox3_CheckedChanged); - // - // textBox4 - // - this.textBox4.Enabled = false; - this.textBox4.Location = new System.Drawing.Point(9, 79); - this.textBox4.Name = "textBox4"; - this.textBox4.PasswordChar = '*'; - this.textBox4.Size = new System.Drawing.Size(155, 20); - this.textBox4.TabIndex = 3; - // - // textBox3 - // - this.textBox3.Enabled = false; - this.textBox3.Location = new System.Drawing.Point(9, 38); - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(155, 20); - this.textBox3.TabIndex = 2; - this.textBox3.TextChanged += new System.EventHandler(this.TextBox3_TextChanged); - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(6, 63); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(53, 13); - this.label4.TabIndex = 1; - this.label4.Text = "Password"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(6, 21); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(55, 13); - this.label3.TabIndex = 0; - this.label3.Text = "Username"; - // // button2 // - this.button2.Location = new System.Drawing.Point(12, 327); + this.button2.Location = new System.Drawing.Point(12, 280); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(75, 23); this.button2.TabIndex = 10; @@ -294,41 +180,65 @@ // // groupBox5 // + this.groupBox5.Controls.Add(this.textBox2); + this.groupBox5.Controls.Add(this.label9); + this.groupBox5.Controls.Add(this.checkBox8); + this.groupBox5.Controls.Add(this.textBox9); this.groupBox5.Controls.Add(this.label8); this.groupBox5.Controls.Add(this.label7); this.groupBox5.Controls.Add(this.checkBox6); this.groupBox5.Controls.Add(this.checkBox5); this.groupBox5.Controls.Add(this.textBox8); this.groupBox5.Controls.Add(this.textBox7); - this.groupBox5.Location = new System.Drawing.Point(12, 240); + this.groupBox5.Location = new System.Drawing.Point(12, 148); this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(366, 81); + this.groupBox5.Size = new System.Drawing.Size(366, 126); this.groupBox5.TabIndex = 11; this.groupBox5.TabStop = false; this.groupBox5.Text = "Commands"; // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(12, 45); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(58, 13); + this.label9.TabIndex = 14; + this.label9.Text = "MAC : Port"; + // + // checkBox8 + // + this.checkBox8.AutoSize = true; + this.checkBox8.Location = new System.Drawing.Point(316, 45); + this.checkBox8.Name = "checkBox8"; + this.checkBox8.Size = new System.Drawing.Size(44, 17); + this.checkBox8.TabIndex = 13; + this.checkBox8.Text = "Edit"; + this.checkBox8.UseVisualStyleBackColor = true; + this.checkBox8.CheckedChanged += new System.EventHandler(this.checkBox8_CheckedChanged); + // + // textBox9 + // + this.textBox9.Enabled = false; + this.textBox9.Location = new System.Drawing.Point(154, 39); + this.textBox9.Name = "textBox9"; + this.textBox9.Size = new System.Drawing.Size(99, 20); + this.textBox9.TabIndex = 12; + this.textBox9.Text = "00-00-00-00-00-00"; + // // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(12, 48); + this.label8.Location = new System.Drawing.Point(12, 91); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(105, 13); this.label8.TabIndex = 10; this.label8.Text = "Shutdown Command"; // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(12, 22); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(79, 13); - this.label7.TabIndex = 9; - this.label7.Text = "Boot Command"; - // // checkBox6 // this.checkBox6.AutoSize = true; - this.checkBox6.Location = new System.Drawing.Point(316, 47); + this.checkBox6.Location = new System.Drawing.Point(316, 89); this.checkBox6.Name = "checkBox6"; this.checkBox6.Size = new System.Drawing.Size(44, 17); this.checkBox6.TabIndex = 8; @@ -339,7 +249,7 @@ // checkBox5 // this.checkBox5.AutoSize = true; - this.checkBox5.Location = new System.Drawing.Point(316, 21); + this.checkBox5.Location = new System.Drawing.Point(316, 67); this.checkBox5.Name = "checkBox5"; this.checkBox5.Size = new System.Drawing.Size(44, 17); this.checkBox5.TabIndex = 7; @@ -350,7 +260,7 @@ // textBox8 // this.textBox8.Enabled = false; - this.textBox8.Location = new System.Drawing.Point(154, 45); + this.textBox8.Location = new System.Drawing.Point(154, 87); this.textBox8.Name = "textBox8"; this.textBox8.Size = new System.Drawing.Size(156, 20); this.textBox8.TabIndex = 1; @@ -358,16 +268,34 @@ // textBox7 // this.textBox7.Enabled = false; - this.textBox7.Location = new System.Drawing.Point(154, 19); + this.textBox7.Location = new System.Drawing.Point(154, 65); this.textBox7.Name = "textBox7"; this.textBox7.Size = new System.Drawing.Size(156, 20); this.textBox7.TabIndex = 0; // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(12, 68); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(96, 13); + this.label7.TabIndex = 9; + this.label7.Text = "Broadcast Address"; + // + // textBox2 + // + this.textBox2.Enabled = false; + this.textBox2.Location = new System.Drawing.Point(263, 39); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(47, 20); + this.textBox2.TabIndex = 15; + this.textBox2.Text = "9"; + // // Settings // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(390, 364); + this.ClientSize = new System.Drawing.Size(390, 311); this.Controls.Add(this.groupBox5); this.Controls.Add(this.button2); this.Controls.Add(this.groupBox2); @@ -383,10 +311,7 @@ this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); + this.groupBox2.PerformLayout(); this.groupBox5.ResumeLayout(false); this.groupBox5.PerformLayout(); this.ResumeLayout(false); @@ -397,32 +322,26 @@ private System.Windows.Forms.Button button1; private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; public System.Windows.Forms.TextBox textBox1; - public System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.CheckBox checkBox1; - private System.Windows.Forms.CheckBox checkBox2; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.TextBox textBox5; private System.Windows.Forms.TextBox textBox6; private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label5; - private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.TextBox textBox4; - private System.Windows.Forms.TextBox textBox3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label label3; private System.Windows.Forms.CheckBox checkBox4; - private System.Windows.Forms.CheckBox checkBox3; private System.Windows.Forms.Button button2; private System.Windows.Forms.GroupBox groupBox5; - private System.Windows.Forms.TextBox textBox7; private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label7; private System.Windows.Forms.CheckBox checkBox6; private System.Windows.Forms.CheckBox checkBox5; private System.Windows.Forms.TextBox textBox8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.CheckBox checkBox8; + private System.Windows.Forms.TextBox textBox9; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox textBox7; + private System.Windows.Forms.TextBox textBox2; } } \ No newline at end of file diff --git a/Server Manager/Form2.cs b/Server Manager/Form2.cs index 79acdd1..48bb1c5 100644 --- a/Server Manager/Form2.cs +++ b/Server Manager/Form2.cs @@ -10,33 +10,35 @@ namespace Server_Manager InitializeComponent(); } - private void GroupBox2_Enter(object sender, EventArgs e) - { - - } - private void Button1_Click(object sender, EventArgs e) { button1.Text = "Saved!"; button1.Enabled = false; - Properties.Settings.Default.NetCardIP = textBox1.Text; - Properties.Settings.Default.OSIP = textBox2.Text; - Properties.Settings.Default.NetCardUser = textBox3.Text; - Properties.Settings.Default.NetCardPass = textBox4.Text; - Properties.Settings.Default.OSUser = textBox6.Text; - Properties.Settings.Default.OSPass = textBox5.Text; - Properties.Settings.Default.StartCmd = textBox7.Text; - Properties.Settings.Default.ShutDwnCmd = textBox8.Text; + Properties.Settings.Default.IP = textBox1.Text; + Properties.Settings.Default.Username = textBox6.Text; + Properties.Settings.Default.Password = textBox5.Text; + Properties.Settings.Default.ShutdownCMD = textBox8.Text; + Properties.Settings.Default.MAC = textBox9.Text; + Properties.Settings.Default.BroadcastIP = textBox7.Text; + Properties.Settings.Default.Port = textBox2.Text; Properties.Settings.Default.Save(); Properties.Settings.Default.Reload(); checkBox1.Checked = false; - checkBox2.Checked = false; - checkBox3.Checked = false; checkBox4.Checked = false; + checkBox5.Checked = false; + checkBox6.Checked = false; + checkBox8.Checked = false; + textBox1.Enabled = false; + textBox2.Enabled = false; + textBox5.Enabled = false; + textBox6.Enabled = false; + textBox7.Enabled = false; + textBox8.Enabled = false; + textBox9.Enabled = false; System.Threading.Thread.Sleep(500); @@ -71,28 +73,13 @@ namespace Server_Manager private void Settings_Load(object sender, EventArgs e) { - textBox1.Text = Properties.Settings.Default.NetCardIP; - textBox2.Text = Properties.Settings.Default.OSIP; - textBox3.Text = Properties.Settings.Default.NetCardUser; - textBox4.Text = Properties.Settings.Default.NetCardPass; - textBox6.Text = Properties.Settings.Default.OSUser; - textBox5.Text = Properties.Settings.Default.OSPass; - textBox7.Text = Properties.Settings.Default.StartCmd; - textBox8.Text = Properties.Settings.Default.ShutDwnCmd; - } - - private void CheckBox3_CheckedChanged(object sender, EventArgs e) - { - if (textBox3.Enabled == true) - { - textBox3.Enabled = false; - textBox4.Enabled = false; - } - else - { - textBox3.Enabled = true; - textBox4.Enabled = true; - } + textBox1.Text = Properties.Settings.Default.IP; + textBox6.Text = Properties.Settings.Default.Username; + textBox5.Text = Properties.Settings.Default.Password; + textBox8.Text = Properties.Settings.Default.ShutdownCMD; + textBox9.Text = Properties.Settings.Default.MAC; + textBox7.Text = Properties.Settings.Default.BroadcastIP; + textBox2.Text = Properties.Settings.Default.Port; } private void CheckBox4_CheckedChanged(object sender, EventArgs e) @@ -109,14 +96,9 @@ namespace Server_Manager } } - private void TextBox3_TextChanged(object sender, EventArgs e) - { - - } - private void Button2_Click_1(object sender, EventArgs e) { - MessageBox.Show("Created by Michał Czyż\n\nCopyright(C) 2020 All Rights Reserved\n\nVersion: 1.0", "About", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show("Created by Michał Czyż\n\nCopyright(c) 2021 All Rights Reserved\n\nVersion: 1.0.0", "About Server Manager", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void checkBox5_CheckedChanged(object sender, EventArgs e) @@ -142,5 +124,17 @@ namespace Server_Manager textBox8.Enabled = true; } } + + private void checkBox8_CheckedChanged(object sender, EventArgs e) + { + if (textBox9.Enabled == true) + { + textBox9.Enabled = false; + } + else + { + textBox9.Enabled = true; + } + } } } diff --git a/Server Manager/License.txt b/Server Manager/License.txt deleted file mode 100644 index 6728e39..0000000 --- a/Server Manager/License.txt +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Telnet contributors. (Telnet@prims.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Server Manager/Properties/Settings.Designer.cs b/Server Manager/Properties/Settings.Designer.cs index a693fc3..91fc114 100644 --- a/Server Manager/Properties/Settings.Designer.cs +++ b/Server Manager/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace Server_Manager.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -25,97 +25,85 @@ namespace Server_Manager.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("192.168.0.200")] - public string NetCardIP { + [global::System.Configuration.DefaultSettingValueAttribute("192.168.0.250")] + public string IP { get { - return ((string)(this["NetCardIP"])); + return ((string)(this["IP"])); } set { - this["NetCardIP"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("192.168.0.17")] - public string OSIP { - get { - return ((string)(this["OSIP"])); - } - set { - this["OSIP"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("USERID")] - public string NetCardUser { - get { - return ((string)(this["NetCardUser"])); - } - set { - this["NetCardUser"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("PASSW0RD")] - public string NetCardPass { - get { - return ((string)(this["NetCardPass"])); - } - set { - this["NetCardPass"] = value; + this["IP"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("domowy")] - public string OSUser { + public string Username { get { - return ((string)(this["OSUser"])); + return ((string)(this["Username"])); } set { - this["OSUser"] = value; + this["Username"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("qaz")] - public string OSPass { + public string Password { get { - return ((string)(this["OSPass"])); + return ((string)(this["Password"])); } set { - this["OSPass"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("power on")] - public string StartCmd { - get { - return ((string)(this["StartCmd"])); - } - set { - this["StartCmd"] = value; + this["Password"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("shutdown -s -t 0")] - public string ShutDwnCmd { + public string ShutdownCMD { get { - return ((string)(this["ShutDwnCmd"])); + return ((string)(this["ShutdownCMD"])); } set { - this["ShutDwnCmd"] = value; + this["ShutdownCMD"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("60-32-B1-D8-C7-A0")] + public string MAC { + get { + return ((string)(this["MAC"])); + } + set { + this["MAC"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("192.168.0.255")] + public string BroadcastIP { + get { + return ((string)(this["BroadcastIP"])); + } + set { + this["BroadcastIP"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("9")] + public string Port { + get { + return ((string)(this["Port"])); + } + set { + this["Port"] = value; } } } diff --git a/Server Manager/Properties/Settings.settings b/Server Manager/Properties/Settings.settings index ca3783c..19f6709 100644 --- a/Server Manager/Properties/Settings.settings +++ b/Server Manager/Properties/Settings.settings @@ -1,30 +1,27 @@  - + - - 192.168.0.200 + + 192.168.0.250 - - 192.168.0.17 - - - USERID - - - PASSW0RD - - + domowy - + qaz - - power on - - + shutdown -s -t 0 + + 60-32-B1-D8-C7-A0 + + + 192.168.0.255 + + + 9 + \ No newline at end of file diff --git a/Server Manager/Server Manager.csproj b/Server Manager/Server Manager.csproj index 341602d..8e50ebf 100644 --- a/Server Manager/Server Manager.csproj +++ b/Server Manager/Server Manager.csproj @@ -23,7 +23,7 @@ false false true - 9 + 10 1.0.0.%2a false true @@ -64,18 +64,13 @@ false - - ..\packages\LiteGuard.1.1.0\lib\net35\LiteGuard.dll - - - ..\packages\Telnet.0.8.4\lib\net451\PrimS.Telnet.NetStandard.dll - - - ..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll + + ..\packages\SSH.NET.2020.0.1\lib\net40\Renci.SshNet.dll + @@ -145,7 +140,6 @@ - \ No newline at end of file diff --git a/Server Manager/packages.config b/Server Manager/packages.config index f16b2ac..5e98293 100644 --- a/Server Manager/packages.config +++ b/Server Manager/packages.config @@ -1,6 +1,4 @@  - - - + \ No newline at end of file