First Commit

This commit is contained in:
eRgo35
2020-09-10 18:47:38 +02:00
parent 3c87d82dff
commit e80e155e06
18 changed files with 3766 additions and 0 deletions

25
Server Manager.sln Normal file
View File

@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29009.5
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server Manager", "Server Manager\Server Manager.csproj", "{DEED01A2-D151-4CFB-AAF2-B263DA8DB640}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DEED01A2-D151-4CFB-AAF2-B263DA8DB640}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEED01A2-D151-4CFB-AAF2-B263DA8DB640}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEED01A2-D151-4CFB-AAF2-B263DA8DB640}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEED01A2-D151-4CFB-AAF2-B263DA8DB640}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {21595E99-5F6B-4970-9815-A588D69F4DC6}
EndGlobalSection
EndGlobal

39
Server Manager/App.config Normal file
View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Cloud_Power_Manager.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<userSettings>
<Cloud_Power_Manager.Properties.Settings>
<setting name="NetCardIP" serializeAs="String">
<value>192.168.0.200</value>
</setting>
<setting name="OSIP" serializeAs="String">
<value>192.168.0.17</value>
</setting>
<setting name="NetCardUser" serializeAs="String">
<value>USERID</value>
</setting>
<setting name="NetCardPass" serializeAs="String">
<value>PASSW0RD</value>
</setting>
<setting name="OSUser" serializeAs="String">
<value>domowy</value>
</setting>
<setting name="OSPass" serializeAs="String">
<value>qaz</value>
</setting>
<setting name="StartCmd" serializeAs="String">
<value>power on</value>
</setting>
<setting name="ShutDwnCmd" serializeAs="String">
<value>shutdown -s -t 0</value>
</setting>
</Cloud_Power_Manager.Properties.Settings>
</userSettings>
</configuration>

220
Server Manager/Form1.Designer.cs generated Normal file
View File

@@ -0,0 +1,220 @@
namespace Server_Manager
{
partial class Main
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
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_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.Ping_Stuff.SuspendLayout();
this.Power.SuspendLayout();
this.Explore_Settings.SuspendLayout();
this.SuspendLayout();
//
// 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);
//
// 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);
//
// 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);
//
// 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.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.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;
this.label3.Location = new System.Drawing.Point(194, 20);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(71, 13);
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;
this.label1.Location = new System.Drawing.Point(7, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(105, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Network Card Status";
//
// 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.Name = "Power";
this.Power.Size = new System.Drawing.Size(270, 86);
this.Power.TabIndex = 4;
this.Power.TabStop = false;
this.Power.Text = "Power";
//
// 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.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
//
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
//
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);
//
// timer1
//
this.timer1.Interval = 8000;
this.timer1.Tick += new System.EventHandler(this.Timer1_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.Controls.Add(this.Explore_Settings);
this.Controls.Add(this.Power);
this.Controls.Add(this.Ping_Stuff);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "Main";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Server Power Manager";
this.Load += new System.EventHandler(this.Main_Load);
this.Ping_Stuff.ResumeLayout(false);
this.Ping_Stuff.PerformLayout();
this.Power.ResumeLayout(false);
this.Explore_Settings.ResumeLayout(false);
this.ResumeLayout(false);
}
#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.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;
}
}

218
Server Manager/Form1.cs Normal file
View File

@@ -0,0 +1,218 @@
using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
using Renci.SshNet;
using Renci.SshNet.Common;
namespace Server_Manager
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
private void Settings_Click(object sender, EventArgs e)
{
Settings stgs = new Settings();
stgs.Show();
}
private void Open_win_exporer_Click(object sender, EventArgs e)
{
var OSIP = Properties.Settings.Default.OSIP;
Thread exp = new Thread(() =>
{
_ = System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo()
{
FileName = "\\\\" + OSIP + "\\",
UseShellExecute = true,
Verb = "open"
});
});
exp.Start();
}
private bool checkNetCardIP()
{
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;
}
}
private void Main_Load(object sender, EventArgs e)
{
// timer1.Start();
Thread pingTest = new Thread(() =>
{
NetCardStatus = checkNetCardIP();
OSStatus = checkOSIP();
Action action = new Action(SetColorsofLabels);
BeginInvoke(action);
});
pingTest.Start();
}
bool NetCardStatus = false;
bool OSStatus = false;
private void Ping_button_Click(object sender, EventArgs e)
{
Thread pingTest = new Thread(() =>
{
NetCardStatus = checkNetCardIP();
OSStatus = checkOSIP();
Action action = new Action(SetColorsofLabels);
BeginInvoke(action);
});
pingTest.Start();
ping_button.Enabled = false;
label3.Text = "CHECKING...";
label3.ForeColor = Color.Black;
label4.Text = "CHECKING...";
label4.ForeColor = Color.Black;
}
private void SetColorsofLabels()
{
if (NetCardStatus == true)
{
label3.Text = "ONLINE";
label3.ForeColor = Color.Green;
}
else
{
label3.Text = "OFFLINE";
label3.ForeColor = Color.Red;
}
if (OSStatus == true)
{
label4.Text = "ONLINE";
label4.ForeColor = Color.Green;
}
else
{
label4.Text = "OFFLINE";
label4.ForeColor = Color.Red;
}
if (label3.Text == "OFFLINE" && label4.Text == "OFFLINE")
{
power_on.Enabled = false;
power_off.Enabled = false;
open_win_exporer.Enabled = false;
}
else if (label3.Text == "ONLINE" && label4.Text == "OFFLINE")
{
power_on.Enabled = true;
power_off.Enabled = false;
open_win_exporer.Enabled = false;
}
else if (label3.Text == "ONLINE" && label4.Text == "ONLINE")
{
power_on.Enabled = false;
power_off.Enabled = true;
open_win_exporer.Enabled = true;
}
ping_button.Enabled = true;
}
private void Power_on_Click(object sender, EventArgs e)
{
power_on.Enabled = false;
power_on.Text = "Booting...";
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) =>
{
d.Prompts.Single().Response = password;
};
using (var client = new SshClient(clientip, username, authMethod.ToString()))
{
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;
}
}
}
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))
{
try
{
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";
}
}
}
private void Timer1_Tick(object sender, EventArgs e)
{
ping_button.PerformClick();
}
}
}

2014
Server Manager/Form1.resx Normal file

File diff suppressed because it is too large Load Diff

428
Server Manager/Form2.Designer.cs generated Normal file
View File

@@ -0,0 +1,428 @@
namespace Server_Manager
{
partial class Settings
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
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.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.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.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "OK";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.Button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 21);
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;
this.textBox1.Location = new System.Drawing.Point(154, 18);
this.textBox1.MaxLength = 50;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(156, 20);
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;
this.checkBox1.Location = new System.Drawing.Point(316, 21);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(44, 17);
this.checkBox1.TabIndex = 6;
this.checkBox1.Text = "Edit";
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.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.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(366, 136);
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.Name = "checkBox4";
this.checkBox4.Size = new System.Drawing.Size(44, 17);
this.checkBox4.TabIndex = 5;
this.checkBox4.Text = "Edit";
this.checkBox4.UseVisualStyleBackColor = true;
this.checkBox4.CheckedChanged += new System.EventHandler(this.CheckBox4_CheckedChanged);
//
// textBox5
//
this.textBox5.Enabled = false;
this.textBox5.Location = new System.Drawing.Point(6, 79);
this.textBox5.Name = "textBox5";
this.textBox5.PasswordChar = '*';
this.textBox5.Size = new System.Drawing.Size(155, 20);
this.textBox5.TabIndex = 7;
//
// textBox6
//
this.textBox6.Enabled = false;
this.textBox6.Location = new System.Drawing.Point(6, 38);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(155, 20);
this.textBox6.TabIndex = 6;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(3, 21);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(55, 13);
this.label6.TabIndex = 4;
this.label6.Text = "Username";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(3, 63);
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.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 10;
this.button2.Text = "About";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.Button2_Click_1);
//
// groupBox5
//
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.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(366, 81);
this.groupBox5.TabIndex = 11;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Commands";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(12, 48);
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.Name = "checkBox6";
this.checkBox6.Size = new System.Drawing.Size(44, 17);
this.checkBox6.TabIndex = 8;
this.checkBox6.Text = "Edit";
this.checkBox6.UseVisualStyleBackColor = true;
this.checkBox6.CheckedChanged += new System.EventHandler(this.checkBox6_CheckedChanged);
//
// checkBox5
//
this.checkBox5.AutoSize = true;
this.checkBox5.Location = new System.Drawing.Point(316, 21);
this.checkBox5.Name = "checkBox5";
this.checkBox5.Size = new System.Drawing.Size(44, 17);
this.checkBox5.TabIndex = 7;
this.checkBox5.Text = "Edit";
this.checkBox5.UseVisualStyleBackColor = true;
this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
//
// textBox8
//
this.textBox8.Enabled = false;
this.textBox8.Location = new System.Drawing.Point(154, 45);
this.textBox8.Name = "textBox8";
this.textBox8.Size = new System.Drawing.Size(156, 20);
this.textBox8.TabIndex = 1;
//
// textBox7
//
this.textBox7.Enabled = false;
this.textBox7.Location = new System.Drawing.Point(154, 19);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(156, 20);
this.textBox7.TabIndex = 0;
//
// 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.Controls.Add(this.groupBox5);
this.Controls.Add(this.button2);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Settings";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Settings";
this.Load += new System.EventHandler(this.Settings_Load);
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.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.ResumeLayout(false);
}
#endregion
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;
}
}

146
Server Manager/Form2.cs Normal file
View File

@@ -0,0 +1,146 @@
using System;
using System.Windows.Forms;
namespace Server_Manager
{
public partial class Settings : Form
{
public Settings()
{
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.Save();
Properties.Settings.Default.Reload();
checkBox1.Checked = false;
checkBox2.Checked = false;
checkBox3.Checked = false;
checkBox4.Checked = false;
System.Threading.Thread.Sleep(500);
this.Hide();
this.Dispose();
}
private void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (textBox1.Enabled == true)
{
textBox1.Enabled = false;
}
else
{
textBox1.Enabled = true;
}
}
private void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
if (textBox2.Enabled == true)
{
textBox2.Enabled = false;
}
else
{
textBox2.Enabled = true;
}
}
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;
}
}
private void CheckBox4_CheckedChanged(object sender, EventArgs e)
{
if (textBox6.Enabled == true)
{
textBox6.Enabled = false;
textBox5.Enabled = false;
}
else
{
textBox6.Enabled = true;
textBox5.Enabled = true;
}
}
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);
}
private void checkBox5_CheckedChanged(object sender, EventArgs e)
{
if (textBox7.Enabled == true)
{
textBox7.Enabled = false;
}
else
{
textBox7.Enabled = true;
}
}
private void checkBox6_CheckedChanged(object sender, EventArgs e)
{
if (textBox8.Enabled == true)
{
textBox8.Enabled = false;
}
else
{
textBox8.Enabled = true;
}
}
}
}

120
Server Manager/Form2.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: 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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<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:sequence>
<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="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,9 @@
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.

22
Server Manager/Program.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Server_Manager
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Server Power Manager")]
[assembly: AssemblyDescription("Turn on or Turn off your Server in LAN")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Michał Czyż")]
[assembly: AssemblyProduct("Server Power Manager")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("deed01a2-d151-4cfb-aaf2-b263da8db640")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Server_Manager.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Server_Manager.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: 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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<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:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,122 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Server_Manager.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("192.168.0.200")]
public string NetCardIP {
get {
return ((string)(this["NetCardIP"]));
}
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;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("domowy")]
public string OSUser {
get {
return ((string)(this["OSUser"]));
}
set {
this["OSUser"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("qaz")]
public string OSPass {
get {
return ((string)(this["OSPass"]));
}
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;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("shutdown -s -t 0")]
public string ShutDwnCmd {
get {
return ((string)(this["ShutDwnCmd"]));
}
set {
this["ShutDwnCmd"] = value;
}
}
}
}

View File

@@ -0,0 +1,30 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Cloud_Power_Manager.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="NetCardIP" Type="System.String" Scope="User">
<Value Profile="(Default)">192.168.0.200</Value>
</Setting>
<Setting Name="OSIP" Type="System.String" Scope="User">
<Value Profile="(Default)">192.168.0.17</Value>
</Setting>
<Setting Name="NetCardUser" Type="System.String" Scope="User">
<Value Profile="(Default)">USERID</Value>
</Setting>
<Setting Name="NetCardPass" Type="System.String" Scope="User">
<Value Profile="(Default)">PASSW0RD</Value>
</Setting>
<Setting Name="OSUser" Type="System.String" Scope="User">
<Value Profile="(Default)">domowy</Value>
</Setting>
<Setting Name="OSPass" Type="System.String" Scope="User">
<Value Profile="(Default)">qaz</Value>
</Setting>
<Setting Name="StartCmd" Type="System.String" Scope="User">
<Value Profile="(Default)">power on</Value>
</Setting>
<Setting Name="ShutDwnCmd" Type="System.String" Scope="User">
<Value Profile="(Default)">shutdown -s -t 0</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DEED01A2-D151-4CFB-AAF2-B263DA8DB640}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Server_Manager</RootNamespace>
<AssemblyName>Server Manager</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>9</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>if_network-workgroup_118928.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>2E4750934B3C9E901CD24A427CFD87D3C6B667DC</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>Cloud Power Manager_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="LiteGuard, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\LiteGuard.1.1.0\lib\net35\LiteGuard.dll</HintPath>
</Reference>
<Reference Include="PrimS.Telnet.NetStandard, Version=0.8.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Telnet.0.8.4\lib\net451\PrimS.Telnet.NetStandard.dll</HintPath>
</Reference>
<Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Form2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form2.Designer.cs">
<DependentUpon>Form2.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form2.resx">
<DependentUpon>Form2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="if_network-workgroup_118928.ico" />
<Content Include="License.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LiteGuard" version="1.1.0" targetFramework="net472" />
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
<package id="Telnet" version="0.8.4" targetFramework="net472" />
</packages>