From face9ba963c739904d1bb98eb931d9108595cdcf Mon Sep 17 00:00:00 2001 From: klavirshik Date: Tue, 23 Jul 2024 10:23:13 +0200 Subject: [PATCH] update reset --- Reseter2/Form1.Designer.cs | 19 ++++- Reseter2/Form1.cs | 2 + Reseter2/Form1.resx | 18 +++++ Reseter2/FormHistory.Designer.cs | 46 ++++++++++++ Reseter2/FormHistory.cs | 20 ++++++ Reseter2/FormHistory.resx | 120 +++++++++++++++++++++++++++++++ Reseter2/ReseteTask.cs | 4 +- Reseter2/Reseter2.csproj | 9 +++ Reseter2/Shutdown.cs | 6 +- Reseter2/StatusRebootStop.cs | 2 +- Reseter2/TaskControl.Designer.cs | 7 +- 11 files changed, 242 insertions(+), 11 deletions(-) create mode 100644 Reseter2/FormHistory.Designer.cs create mode 100644 Reseter2/FormHistory.cs create mode 100644 Reseter2/FormHistory.resx diff --git a/Reseter2/Form1.Designer.cs b/Reseter2/Form1.Designer.cs index e1208c9..8761434 100644 --- a/Reseter2/Form1.Designer.cs +++ b/Reseter2/Form1.Designer.cs @@ -38,6 +38,7 @@ this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.timer1 = new System.Windows.Forms.Timer(this.components); + this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -72,7 +73,8 @@ // this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripButton1, - this.toolStripButton2}); + this.toolStripButton2, + this.toolStripButton3}); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(394, 25); @@ -104,11 +106,11 @@ | System.Windows.Forms.AnchorStyles.Right))); this.flowLayoutPanel1.AutoScroll = true; this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.flowLayoutPanel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 67); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(394, 650); + this.flowLayoutPanel1.Size = new System.Drawing.Size(394, 654); this.flowLayoutPanel1.TabIndex = 4; this.flowLayoutPanel1.WrapContents = false; // @@ -118,6 +120,16 @@ this.timer1.Interval = 1000; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // + // toolStripButton3 + // + this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image"))); + this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton3.Name = "toolStripButton3"; + this.toolStripButton3.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.toolStripButton3.Size = new System.Drawing.Size(86, 22); + this.toolStripButton3.Text = "О программе"; + // // Form1 // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -147,6 +159,7 @@ private System.Windows.Forms.ToolStripButton toolStripButton2; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.ToolStripButton toolStripButton3; } } diff --git a/Reseter2/Form1.cs b/Reseter2/Form1.cs index df2f0bc..00ddeea 100644 --- a/Reseter2/Form1.cs +++ b/Reseter2/Form1.cs @@ -16,6 +16,8 @@ namespace Reseter2 { InitializeComponent(); + flowLayoutPanel1.AutoScrollMinSize = new Size(0, 655) ; + flowLayoutPanel1.VerticalScroll.Visible = true; Reseter.SetForm(flowLayoutPanel1); } diff --git a/Reseter2/Form1.resx b/Reseter2/Form1.resx index b11c861..64cda44 100644 --- a/Reseter2/Form1.resx +++ b/Reseter2/Form1.resx @@ -151,6 +151,24 @@ TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + + True + 122, 17 diff --git a/Reseter2/FormHistory.Designer.cs b/Reseter2/FormHistory.Designer.cs new file mode 100644 index 0000000..819e3f9 --- /dev/null +++ b/Reseter2/FormHistory.Designer.cs @@ -0,0 +1,46 @@ +namespace Reseter2 +{ + partial class FormHistory + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // FormHistory + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(403, 450); + this.Name = "FormHistory"; + this.Text = "FormHistory"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/Reseter2/FormHistory.cs b/Reseter2/FormHistory.cs new file mode 100644 index 0000000..a4e3d1d --- /dev/null +++ b/Reseter2/FormHistory.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Reseter2 +{ + public partial class FormHistory : Form + { + public FormHistory() + { + InitializeComponent(); + } + } +} diff --git a/Reseter2/FormHistory.resx b/Reseter2/FormHistory.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Reseter2/FormHistory.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Reseter2/ReseteTask.cs b/Reseter2/ReseteTask.cs index d283931..929d6e7 100644 --- a/Reseter2/ReseteTask.cs +++ b/Reseter2/ReseteTask.cs @@ -16,7 +16,7 @@ namespace Reseter2 private TaskControl taskControl; private Pinger Pingers; public Stopwatch sw = new Stopwatch(); - + public PingResult pingResult; public ReseterTask(IComp comp, TaskControl taskCntrl) @@ -33,7 +33,7 @@ namespace Reseter2 { if (task.IsCompleted){ //this.DataContrl(Ping().ToString(), Timeout().ToString()); - PingResult pingResult = await task; + pingResult = await task; taskControl.DataContrl(pingResult.Ping.ToString() + "ms", pingResult.TimeoutPing.ToString(), pingResult.Ip, sw.Elapsed); StatusTask.Next(); task = Task.Run(StatusTask.Tick); diff --git a/Reseter2/Reseter2.csproj b/Reseter2/Reseter2.csproj index deb89bd..07d210e 100644 --- a/Reseter2/Reseter2.csproj +++ b/Reseter2/Reseter2.csproj @@ -53,6 +53,12 @@ Form1.cs + + Form + + + FormHistory.cs + @@ -76,6 +82,9 @@ Form1.cs + + FormHistory.cs + ResXFileCodeGenerator Resources.Designer.cs diff --git a/Reseter2/Shutdown.cs b/Reseter2/Shutdown.cs index 09791ec..6825120 100644 --- a/Reseter2/Shutdown.cs +++ b/Reseter2/Shutdown.cs @@ -15,7 +15,11 @@ namespace Reseter2 } public static void RestartPC(string param) { - StartShutDown("-f -r -t 5" + param); + if (param.Length > 0) + { + StartShutDown("-r -m \\\\" + param + "-f -t 5"); + } + } public static void LogOff() { diff --git a/Reseter2/StatusRebootStop.cs b/Reseter2/StatusRebootStop.cs index 4f53fa3..3b17068 100644 --- a/Reseter2/StatusRebootStop.cs +++ b/Reseter2/StatusRebootStop.cs @@ -12,7 +12,7 @@ namespace Reseter2 public StatusRebootStop(ReseterTask reseterTask) : base(reseterTask) { resetertask.SetNameStage("Перезагрузка остановленна"); - PingResult = resetertask.Ping(); + PingResult = resetertask.pingResult; reseterTask.sw.Stop(); } diff --git a/Reseter2/TaskControl.Designer.cs b/Reseter2/TaskControl.Designer.cs index 73df15e..5f151b6 100644 --- a/Reseter2/TaskControl.Designer.cs +++ b/Reseter2/TaskControl.Designer.cs @@ -128,7 +128,7 @@ // // button1 // - this.button1.Location = new System.Drawing.Point(270, 5); + this.button1.Location = new System.Drawing.Point(270, 3); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(96, 23); this.button1.TabIndex = 9; @@ -138,7 +138,7 @@ // // button2 // - this.button2.Location = new System.Drawing.Point(270, 47); + this.button2.Location = new System.Drawing.Point(270, 49); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(96, 23); this.button2.TabIndex = 10; @@ -186,7 +186,6 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Controls.Add(this.lb_time); this.Controls.Add(this.label3); this.Controls.Add(this.button3); @@ -203,7 +202,7 @@ this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Name = "TaskControl"; - this.Size = new System.Drawing.Size(369, 75); + this.Size = new System.Drawing.Size(371, 77); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); this.PerformLayout();