This commit is contained in:
2023-01-15 15:04:00 +03:00
parent 4649373a3d
commit d3171a1164
20 changed files with 1018 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ sealed partial class MainMenu
this.CountValueTest = new System.Windows.Forms.Button();
this.SimpleMapperTest = new System.Windows.Forms.Button();
this.FileExtensionTest = new System.Windows.Forms.Button();
this.OsInfoBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// CountValueTest
@@ -63,11 +64,22 @@ sealed partial class MainMenu
this.FileExtensionTest.UseVisualStyleBackColor = true;
this.FileExtensionTest.Click += new System.EventHandler(this.FileExtensionTest_Click);
//
// OsInfoBtn
//
this.OsInfoBtn.Location = new System.Drawing.Point(12, 185);
this.OsInfoBtn.Name = "OsInfoBtn";
this.OsInfoBtn.Size = new System.Drawing.Size(335, 51);
this.OsInfoBtn.TabIndex = 3;
this.OsInfoBtn.Text = "Информация о системе";
this.OsInfoBtn.UseVisualStyleBackColor = true;
this.OsInfoBtn.Click += new System.EventHandler(this.OsInfoBtn_Click);
//
// MainMenu
//
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(361, 252);
this.Controls.Add(this.OsInfoBtn);
this.Controls.Add(this.FileExtensionTest);
this.Controls.Add(this.SimpleMapperTest);
this.Controls.Add(this.CountValueTest);
@@ -86,4 +98,5 @@ sealed partial class MainMenu
private Button CountValueTest;
private Button SimpleMapperTest;
private Button FileExtensionTest;
private Button OsInfoBtn;
}

View File

@@ -23,4 +23,10 @@ public sealed partial class MainMenu: Form
FileHashAndMimeType formTest = new();
formTest.ShowDialog();
}
private void OsInfoBtn_Click (object sender, EventArgs e)
{
OsInfoFrm formTest = new();
formTest.ShowDialog();
}
}

65
demo/OsInfoFrm.Designer.cs generated Normal file
View File

@@ -0,0 +1,65 @@
namespace demo;
sealed partial class OsInfoFrm
{
/// <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.textBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox
//
this.textBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox.Location = new System.Drawing.Point(0, 0);
this.textBox.Multiline = true;
this.textBox.Name = "textBox";
this.textBox.Size = new System.Drawing.Size(1029, 510);
this.textBox.TabIndex = 0;
//
// OsInfoFrm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1029, 510);
this.Controls.Add(this.textBox);
this.Font = new System.Drawing.Font("Courier New", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "OsInfoFrm";
this.Text = "Информация о системе";
this.Load += new System.EventHandler(this.OsInfoFrm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private TextBox textBox;
}

28
demo/OsInfoFrm.cs Normal file
View File

@@ -0,0 +1,28 @@
using anbs_cp.Classes;
using Newtonsoft.Json;
namespace demo;
public sealed partial class OsInfoFrm: Form
{
public OsInfoFrm ()
{
InitializeComponent();
}
private void OsInfoFrm_Load (object sender, EventArgs e)
{
textBox.Text = @"Процессор(ы) | ";
textBox.Text += JsonConvert.SerializeObject(OsInfo.Processors);
textBox.Text += @"Оперативная память | ";
textBox.Text += JsonConvert.SerializeObject(OsInfo.RAM);
textBox.Text += @"Видеокарта | ";
textBox.Text += JsonConvert.SerializeObject(OsInfo.Videos);
textBox.Text += @"Диски | ";
textBox.Text += JsonConvert.SerializeObject(OsInfo.Drives);
textBox.Text += @"Windows | ";
textBox.Text += JsonConvert.SerializeObject(OsInfo.Windows);
textBox.Text += @"Net | ";
textBox.Text += JsonConvert.SerializeObject(OsInfo.Net);
}
}

60
demo/OsInfoFrm.resx Normal file
View File

@@ -0,0 +1,60 @@
<root>
<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>