Initialized

This commit is contained in:
Eugen Höglinger 2024-10-02 14:39:21 +02:00
commit 8b3d0b35de
52 changed files with 1622 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,65 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}|Test_WindowsInfo\\Test_WindowsInfo.csproj|c:\\cad\\git-workrepository\\visualstudio\\_dll\\windowsinfo.git\\test_windowsinfo\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}|Test_WindowsInfo\\Test_WindowsInfo.csproj|solutionrelative:test_windowsinfo\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
},
{
"AbsoluteMoniker": "D:0:0:{98F90132-262C-4D6E-B110-572FF383D42B}|WindowsInfo\\WindowsInfo.csproj|c:\\cad\\git-workrepository\\visualstudio\\_dll\\windowsinfo.git\\windowsinfo\\windowsinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{98F90132-262C-4D6E-B110-572FF383D42B}|WindowsInfo\\WindowsInfo.csproj|solutionrelative:windowsinfo\\windowsinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 3,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Form1.cs [Entwurf]",
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\Test_WindowsInfo\\Form1.cs",
"RelativeDocumentMoniker": "Test_WindowsInfo\\Form1.cs",
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\Test_WindowsInfo\\Form1.cs [Entwurf]",
"RelativeToolTip": "Test_WindowsInfo\\Form1.cs [Entwurf]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-02T12:38:14.02Z",
"EditorCaption": " [Entwurf]"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "WindowsInfo.cs",
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\WindowsInfo\\WindowsInfo.cs",
"RelativeDocumentMoniker": "WindowsInfo\\WindowsInfo.cs",
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\WindowsInfo\\WindowsInfo.cs",
"RelativeToolTip": "WindowsInfo\\WindowsInfo.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-02T12:38:09.561Z",
"EditorCaption": ""
}
]
}
]
}
]
}

View File

@ -0,0 +1,65 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}|Test_WindowsInfo\\Test_WindowsInfo.csproj|c:\\cad\\git-workrepository\\visualstudio\\_dll\\windowsinfo.git\\test_windowsinfo\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}|Test_WindowsInfo\\Test_WindowsInfo.csproj|solutionrelative:test_windowsinfo\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
},
{
"AbsoluteMoniker": "D:0:0:{98F90132-262C-4D6E-B110-572FF383D42B}|WindowsInfo\\WindowsInfo.csproj|c:\\cad\\git-workrepository\\visualstudio\\_dll\\windowsinfo.git\\windowsinfo\\windowsinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{98F90132-262C-4D6E-B110-572FF383D42B}|WindowsInfo\\WindowsInfo.csproj|solutionrelative:windowsinfo\\windowsinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 3,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Form1.cs [Entwurf]",
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\Test_WindowsInfo\\Form1.cs",
"RelativeDocumentMoniker": "Test_WindowsInfo\\Form1.cs",
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\Test_WindowsInfo\\Form1.cs [Entwurf]",
"RelativeToolTip": "Test_WindowsInfo\\Form1.cs [Entwurf]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-02T12:38:14.02Z",
"EditorCaption": " [Entwurf]"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "WindowsInfo.cs",
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\WindowsInfo\\WindowsInfo.cs",
"RelativeDocumentMoniker": "WindowsInfo\\WindowsInfo.cs",
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\WindowsInfo\\WindowsInfo.cs",
"RelativeToolTip": "WindowsInfo\\WindowsInfo.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-02T12:38:09.561Z",
"EditorCaption": ""
}
]
}
]
}
]
}

View File

@ -0,0 +1 @@
{"RootPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\Test_WindowsInfo","ProjectFileName":"Test_WindowsInfo.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Form1.cs"},{"SourceFile":"Form1.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\WindowsInfo\\bin\\Debug\\hewininfo.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\Test_WindowsInfo\\bin\\Debug\\Test_WindowsInfo.exe","OutputItemRelativePath":"Test_WindowsInfo.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

130
Test_WindowsInfo/Form1.Designer.cs generated Normal file
View File

@ -0,0 +1,130 @@
namespace Test_WindowsInfo
{
partial class Form1
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.buttonWindowsInfo = new System.Windows.Forms.Button();
this.labelWindowsInfo = new System.Windows.Forms.Label();
this.groupBoxProgramInfo = new System.Windows.Forms.GroupBox();
this.labelProgramInfo = new System.Windows.Forms.Label();
this.groupBoxDLLInfo = new System.Windows.Forms.GroupBox();
this.labelDLLInfo = new System.Windows.Forms.Label();
this.groupBoxProgramInfo.SuspendLayout();
this.groupBoxDLLInfo.SuspendLayout();
this.SuspendLayout();
//
// buttonWindowsInfo
//
this.buttonWindowsInfo.Location = new System.Drawing.Point(12, 343);
this.buttonWindowsInfo.Name = "buttonWindowsInfo";
this.buttonWindowsInfo.Size = new System.Drawing.Size(775, 23);
this.buttonWindowsInfo.TabIndex = 0;
this.buttonWindowsInfo.Text = "Windows Informationen anzeigen";
this.buttonWindowsInfo.UseVisualStyleBackColor = true;
this.buttonWindowsInfo.Click += new System.EventHandler(this.buttonWindowsInfo_Click);
//
// labelWindowsInfo
//
this.labelWindowsInfo.AutoSize = true;
this.labelWindowsInfo.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelWindowsInfo.Location = new System.Drawing.Point(13, 13);
this.labelWindowsInfo.Name = "labelWindowsInfo";
this.labelWindowsInfo.Size = new System.Drawing.Size(28, 14);
this.labelWindowsInfo.TabIndex = 1;
this.labelWindowsInfo.Text = "...";
//
// groupBoxProgramInfo
//
this.groupBoxProgramInfo.Controls.Add(this.labelProgramInfo);
this.groupBoxProgramInfo.Location = new System.Drawing.Point(12, 372);
this.groupBoxProgramInfo.Name = "groupBoxProgramInfo";
this.groupBoxProgramInfo.Size = new System.Drawing.Size(385, 66);
this.groupBoxProgramInfo.TabIndex = 2;
this.groupBoxProgramInfo.TabStop = false;
this.groupBoxProgramInfo.Text = "Programm Information";
//
// labelProgramInfo
//
this.labelProgramInfo.AutoSize = true;
this.labelProgramInfo.Location = new System.Drawing.Point(7, 20);
this.labelProgramInfo.Name = "labelProgramInfo";
this.labelProgramInfo.Size = new System.Drawing.Size(16, 13);
this.labelProgramInfo.TabIndex = 0;
this.labelProgramInfo.Text = "...";
//
// groupBoxDLLInfo
//
this.groupBoxDLLInfo.Controls.Add(this.labelDLLInfo);
this.groupBoxDLLInfo.Location = new System.Drawing.Point(403, 372);
this.groupBoxDLLInfo.Name = "groupBoxDLLInfo";
this.groupBoxDLLInfo.Size = new System.Drawing.Size(385, 66);
this.groupBoxDLLInfo.TabIndex = 3;
this.groupBoxDLLInfo.TabStop = false;
this.groupBoxDLLInfo.Text = "DLL Information";
//
// labelDLLInfo
//
this.labelDLLInfo.AutoSize = true;
this.labelDLLInfo.Location = new System.Drawing.Point(7, 20);
this.labelDLLInfo.Name = "labelDLLInfo";
this.labelDLLInfo.Size = new System.Drawing.Size(16, 13);
this.labelDLLInfo.TabIndex = 0;
this.labelDLLInfo.Text = "...";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.groupBoxDLLInfo);
this.Controls.Add(this.groupBoxProgramInfo);
this.Controls.Add(this.labelWindowsInfo);
this.Controls.Add(this.buttonWindowsInfo);
this.Name = "Form1";
this.Text = "Test_WindowsInfo";
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBoxProgramInfo.ResumeLayout(false);
this.groupBoxProgramInfo.PerformLayout();
this.groupBoxDLLInfo.ResumeLayout(false);
this.groupBoxDLLInfo.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonWindowsInfo;
private System.Windows.Forms.Label labelWindowsInfo;
private System.Windows.Forms.GroupBox groupBoxProgramInfo;
private System.Windows.Forms.Label labelProgramInfo;
private System.Windows.Forms.GroupBox groupBoxDLLInfo;
private System.Windows.Forms.Label labelDLLInfo;
}
}

170
Test_WindowsInfo/Form1.cs Normal file
View File

@ -0,0 +1,170 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Eugen.ESystem.Windows.Info;
namespace Test_WindowsInfo
{
public partial class Form1 : Form
{
#region Version und Copyright
// Version und Copyright
string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen
string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
string copyright = GenerateCopyright();
string icon = Application.StartupPath + "\\Info.bmp";
//Assembly Datum und Zeit
static DateTime value = AssemblyDateTime();
string date = value.ToShortDateString();
string time = value.ToLongTimeString();
private static DateTime AssemblyDateTime()
{
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision));
//Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original)
return buildDateTime;
}
private static string CurrentYear()
{
DateTime dtn = DateTime.Now;
return dtn.Year.ToString();
}
private static string StartYear()
{
//string startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
//return startYear.Remove(0, startYear.LastIndexOf(" ") + 1);
string startYear = "";
if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © "))
{
startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", "");
while (startYear.StartsWith(" "))
{
startYear = startYear.Remove(0, 1);
}
startYear = startYear.Remove(startYear.IndexOf(" "));
return startYear;
}
else
{
DateTime dtn = DateTime.Now;
return dtn.Year.ToString();
}
}
private static string GenerateCopyright()
{
string startYear = StartYear();
string currentYear = CurrentYear();
if (startYear == currentYear)
{
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
else
{
//return String.Concat(((AssemblyCopyrightAttribute)attributes[0]).Copyright, "-", currentYear);
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace(startYear, String.Concat(startYear, "-", currentYear));
}
}
#endregion
#region Programm-Info
/// <summary>
/// Contains the name of the program file
/// </summary>
public static string ProgramName { set; get; }
/// <summary>
/// Contains the version of the program file
/// </summary>
public static string ProgramVersion { set; get; }
/// <summary>
/// Contains the copyright notice
/// </summary>
public static string Copyright { set; get; }
private void SetProgramInfo()
{
//Name, Version und Copyright setzen
ProgramName = programName;
ProgramVersion = programVersion;
Copyright = copyright;
}
#endregion
public Form1()
{
SetProgramInfo();
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ShowInformation(); //Programm- und DLL-Information anzeigen
}
private void ShowInformation()
{
labelProgramInfo.Text = String.Concat(ProgramName, "\n", ProgramVersion, "\n", Copyright); //Programm-Information anzeigen
// DLL-Information anzeigen
labelDLLInfo.Text = String.Concat(WindowsInfo.DllName, "\n", WindowsInfo.DllVersion, "\n", WindowsInfo.Copyright);
}
private void buttonWindowsInfo_Click(object sender, EventArgs e)
{
//--------------------------------------------------------------
//--- Diesen Bereich ins eigene Programm einfügen --- Anfang ---
//--------------------------------------------------------------
string info = "";
try
{
info = String.Concat("Build Lab: ", WindowsInfo.BuildLab, "\n");
info = String.Concat(info, "Current Build Number: ", WindowsInfo.CurrentBuildNumber, "\n");
info = String.Concat(info, "Current Version: ", WindowsInfo.CurrentVersion, "\n");
info = String.Concat(info, "Edition Id: ", WindowsInfo.EditionId, "\n");
info = String.Concat(info, "Operating System: ", WindowsInfo.OS, "\n");
info = String.Concat(info, "Operating System Archtecture: ", WindowsInfo.OSArchitecture, "\n");
info = String.Concat(info, "Operating System Build: ", WindowsInfo.OSBuild, "\n");
info = String.Concat(info, "Operating System Major Revision: ", WindowsInfo.OSMajorRevision, "\n");
info = String.Concat(info, "Operating System Major Version : ", WindowsInfo.OSMajorVersion, "\n");
info = String.Concat(info, "Operating System Minor Revision: ", WindowsInfo.OSMinorRevision, "\n");
info = String.Concat(info, "Operating System Major Version: ", WindowsInfo.OSMinorVersion, "\n");
info = String.Concat(info, "Operating System Name: ", WindowsInfo.OSName, "\n");
info = String.Concat(info, "Operating System Service Pack: ", WindowsInfo.OSServicePack, "\n");
info = String.Concat(info, "Operating System Version: ", WindowsInfo.OSVersion, "\n");
info = String.Concat(info, "Operating System Version String: ", WindowsInfo.OSVersionString, "\n");
info = String.Concat(info, "Processor Architecture: ", WindowsInfo.ProcessArchitecture, "\n");
info = String.Concat(info, "Product Name: ", WindowsInfo.ProductName, "\n");
info = String.Concat(info, "Released: ", WindowsInfo.ReleaseId, "\n");
}
catch (Exception)
{
MessageBox.Show("Werte konnten nicht gelesen werden");
}
//catch (Exception ex)
//{
// MessageBox.Show(ex.Message);
//}
labelWindowsInfo.Text = info;
//--------------------------------------------------------------
//--- Diesen Bereich ins eigene Programm einfügen --- Ende ---
//--------------------------------------------------------------
}
}
}

120
Test_WindowsInfo/Form1.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,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Test_WindowsInfo
{
static class Program
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("Test_WindowsInfo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Test_WindowsInfo")]
[assembly: AssemblyCopyright("Copyright © 2020 by Eugen Höglinger")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("b5d24208-0ac9-4455-9586-6a3baa3a1a02")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion: 4.0.30319.42000
//
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
// der Code neu generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Test_WindowsInfo.Properties
{
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
// über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test_WindowsInfo.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
/// </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,30 @@
//------------------------------------------------------------------------------
// <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 Test_WindowsInfo.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -0,0 +1,87 @@
<?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>{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Test_WindowsInfo</RootNamespace>
<AssemblyName>Test_WindowsInfo</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>false</Deterministic>
</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>
<ItemGroup>
<Reference Include="hewininfo, Version=1.0.9041.16764, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\WindowsInfo\bin\Debug\hewininfo.dll</HintPath>
</Reference>
<Reference Include="System" />
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.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>
</Compile>
<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>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

View File

@ -0,0 +1 @@
803e574a6828a51a5f0b422298c1f9bb0b71aee87c17e71de363a6cc66170c28

View File

@ -0,0 +1,40 @@
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\Test_WindowsInfo.exe.config
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\Test_WindowsInfo.exe
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\Test_WindowsInfo.pdb
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csprojAssemblyReference.cache
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.Form1.resources
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.Properties.Resources.resources
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.GenerateResource.cache
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.CoreCompileInputs.cache
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.exe
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.pdb
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\WindowsInfo.dll
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\WindowsInfo.pdb
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.CopyComplete
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\Test_WindowsInfo.exe.config
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\Test_WindowsInfo.exe
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\Test_WindowsInfo.pdb
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\hewininfo.dll
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\hewininfo.pdb
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.Form1.resources
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.Properties.Resources.resources
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.GenerateResource.cache
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.CoreCompileInputs.cache
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.CopyComplete
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.exe
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.pdb
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.AssemblyReference.cache
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.SuggestedBindingRedirects.cache
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\Test_WindowsInfo.exe.config
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\Test_WindowsInfo.exe
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\Test_WindowsInfo.pdb
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\hewininfo.pdb
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.AssemblyReference.cache
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.Form1.resources
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.Properties.Resources.resources
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.GenerateResource.cache
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.csproj.CoreCompileInputs.cache
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_Win.39942AAC.Up2Date
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.exe
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\obj\Debug\Test_WindowsInfo.pdb
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\Test_WindowsInfo\bin\Debug\hewininfo.dll

Binary file not shown.

Binary file not shown.

31
WindowsInfo.git.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30621.155
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsInfo", "WindowsInfo\WindowsInfo.csproj", "{98F90132-262C-4D6E-B110-572FF383D42B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_WindowsInfo", "Test_WindowsInfo\Test_WindowsInfo.csproj", "{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{98F90132-262C-4D6E-B110-572FF383D42B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{98F90132-262C-4D6E-B110-572FF383D42B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98F90132-262C-4D6E-B110-572FF383D42B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98F90132-262C-4D6E-B110-572FF383D42B}.Release|Any CPU.Build.0 = Release|Any CPU
{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5D24208-0AC9-4455-9586-6A3BAA3A1A02}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {594721DB-5599-4A15-ABC3-263865C6E5D6}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1 @@
{"RootPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\WindowsInfo","ProjectFileName":"WindowsInfo.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"WindowsInfo.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Management.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_DLL\\WindowsInfo.git\\WindowsInfo\\bin\\Debug\\hewininfo.dll","OutputItemRelativePath":"hewininfo.dll"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("WindowsInfo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WindowsInfo")]
[assembly: AssemblyCopyright("Copyright © 2020 by Eugen Höglinger")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("98f90132-262c-4d6e-b110-572ff383d42b")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]

504
WindowsInfo/WindowsInfo.cs Normal file
View File

@ -0,0 +1,504 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Management;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Win32;
namespace Eugen.ESystem.Windows.Info
{
public class WindowsInfo
{
#region Version und Copyright
// Version und Copyright
static string dllName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen
static string dllVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
static string copyright = GenerateCopyright();
//Assembly Datum und Zeit
static DateTime value = AssemblyDateTime();
static string date = value.ToShortDateString();
static string time = value.ToLongTimeString();
private static DateTime AssemblyDateTime()
{
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision));
//Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original)
return buildDateTime;
}
private static string CurrentYear()
{
DateTime dtn = DateTime.Now;
return dtn.Year.ToString();
}
private static string StartYear()
{
string startYear = "";
if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © "))
{
startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", "");
while (startYear.StartsWith(" "))
{
startYear = startYear.Remove(0, 1);
}
if (startYear.Contains("-"))
{
startYear = startYear.Remove(startYear.IndexOf("-"));
}
else
{
startYear = startYear.Remove(startYear.IndexOf(" "));
}
return startYear;
}
else
{
DateTime dtn = DateTime.Now;
return dtn.Year.ToString();
}
}
private static string GenerateCopyright()
{
string startYear = StartYear();
string currentYear = CurrentYear();
if (startYear == currentYear)
{
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
else
{
string temp = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
string start = temp.Remove(temp.IndexOf(startYear) - 1);
string end = (temp.Remove(0, temp.IndexOf(" by")));
return String.Concat(start, " ", startYear, "-", currentYear, end);
}
}
#endregion
#region DLL-Info
/// <summary>
/// Contains the name of the program file
/// </summary>
public static string DllName { set; get; }
/// <summary>
/// Contains the version of the program file
/// </summary>
public static string DllVersion { set; get; }
/// <summary>
/// Contains the copyright notice
/// </summary>
public static string Copyright { set; get; }
private static void SetDllInfo()
{
//Name, Version und Copyright setzen
DllName = dllName;
DllVersion = dllVersion;
Copyright = copyright;
}
#endregion
/// <summary>
/// Information about Windows
/// </summary>
static WindowsInfo()
{
SetDllInfo(); //Name, Version und Copyright setzen
CollectWindowsInfomations();
}
#region Globale_Variablen
/// <summary>
/// Returns the installed operating system. E.g.: Microsoft Windows 10 Enterprise - 64-Bit
/// </summary>
public static string OS { set; get; }
/// <summary>
/// Returns the product name of the installed operating system. E.g.: Windows 10 Enterprise
/// </summary>
public static string ProductName { set; get; }
/// <summary>
/// Returns the edition ID of the installed operating system. E.g.: Enterprise
/// </summary>
public static string EditionId { set; get; }
/// <summary>
/// Returns the current version of the installed operating system. E.g.: 6.3
/// </summary>
public static string CurrentVersion { set; get; }
/// <summary>
/// Returns the current release ID of the installed operating system. E.g.: 1709
/// </summary>
public static string ReleaseId { set; get; }
/// <summary>
/// Returns the current build number of the installed operating system. E.g.: 16299
/// </summary>
public static string CurrentBuildNumber { set; get; }
/// <summary>
/// Returns the build lab of the installed operating system. E.g.: 16299.431
/// </summary>
public static string BuildLab { set; get; }
/// <summary>
/// Returns the operating system name of the installed operating system. E.g.: Microsoft Windows 10 Enterprise
/// </summary>
public static string OSName { set; get; }
/// <summary>
/// Returns the OS version string of the installed operating system. E.g.: Microsoft Windows NT 6.2.9200.0
/// </summary>
public static string OSVersionString { set; get; }
/// <summary>
/// Returns the OS version of the installed operating system. E.g.: 6.2.9200.0
/// </summary>
public static string OSVersion { set; get; }
/// <summary>
/// Returns the OS architecture of the installed operating system. E.g.: 64-Bit
/// </summary>
public static string OSArchitecture { set; get; }
/// <summary>
/// Returns the OS service pack of the installed operating system. E.g.: SP1
/// </summary>
public static string OSServicePack { set; get; }
/// <summary>
/// Returns the OS major version of the installed operating system. E.g.: 6
/// </summary>
public static int OSMajorVersion { set; get; }
/// <summary>
/// Returns the OS minor version of the installed operating system. E.g.: 2
/// </summary>
public static int OSMinorVersion { set; get; }
/// <summary>
/// Returns the OS major revision of the installed operating system. E.g.: 0
/// </summary>
public static int OSMajorRevision { set; get; }
/// <summary>
/// Returns the OS minor revision of the installed operating system. E.g.: 0
/// </summary>
public static int OSMinorRevision { set; get; }
/// <summary>
/// Returns the OS build of the installed operating system. E.g.: 9200
/// </summary>
public static int OSBuild { set; get; }
/// <summary>
/// Returns the process architecture of the installed operating system. E.g.: Win32NT
/// </summary>
public static string ProcessArchitecture { set; get; }
#endregion
OperatingSystem os = Environment.OSVersion;
#region Methoden
/// <summary>
/// Collects all Windows informations
/// </summary>
/// <exception cref="UnableToReadOSInformationException">If a value cannot be read, an exception is thrown</exception>
public static void CollectWindowsInfomations()
{
try
{
OS = GetOS();
ProductName = GetProductName();
EditionId = GetEditionId();
CurrentVersion = GetCurrentVersion();
ReleaseId = GetReleaseId();
CurrentBuildNumber = GetCurrentBuildNumber();
BuildLab = GetBuildLab();
OSName = GetOSName();
OSVersionString = GetOSVersionString();
OSVersion = GetOSVersion();
OSArchitecture = GetOSArchitecture();
OSServicePack = GetOSServicePack();
OSMajorVersion = GetOSMajorVersion();
OSMinorVersion = GetOSMinorVersion();
OSMajorRevision = GetOSMajorRevision();
OSMinorRevision = GetOSMinorRevision();
OSBuild = GetOSBuild();
ProcessArchitecture = GetProcessArchitecture();
}
catch (Exception)
{
throw new UnableToReadOSInformationException();
}
}
/// <summary>
/// Get the installed operating system.
/// </summary>
/// <returns>The installed OS. E.g.: Microsoft Windows 10 Enterprise - 64-Bit</returns>
private static string GetOS()
{
string r = "";
using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"))
{
ManagementObjectCollection information = searcher.Get();
if (information != null)
{
foreach (ManagementObject obj in information)
{
r = obj["Caption"].ToString() + " - " + obj["OSArchitecture"].ToString();
}
}
r = r.Replace("NT 5.1.2600", "XP");
r = r.Replace("NT 5.2.3790", "Server 2003");
}
return r;
}
/// <summary>
/// Get the product name of the installed operating system.
/// </summary>
/// <returns>The product name. E.g.: Windows 10 Enterprise</returns>
private static string GetProductName()
{
var regKey = Registry.LocalMachine;
var subKey = regKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
return subKey.GetValue("ProductName").ToString();
}
/// <summary>
/// Get the edition ID of the installed operating system.
/// </summary>
/// <returns>The edition ID. E.g.: Enterprise</returns>
private static string GetEditionId()
{
var regKey = Registry.LocalMachine;
var subKey = regKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
return subKey.GetValue("EditionID").ToString();
}
/// <summary>
/// Get the current version of the installed operating system.
/// </summary>
/// <returns>The current version. E.g.: 6.3</returns>
private static string GetCurrentVersion()
{
var regKey = Registry.LocalMachine;
var subKey = regKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
return subKey.GetValue("CurrentVersion").ToString();
}
/// <summary>
/// Get the current release ID of the installed operating system.
/// </summary>
/// <returns>The current release ID. E.g.: 1709</returns>
private static string GetReleaseId()
{
var regKey = Registry.LocalMachine;
var subKey = regKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
return subKey.GetValue("ReleaseId").ToString();
}
/// <summary>
/// Get the current build number of the installed operating system.
/// </summary>
/// <returns>The current build number. E.g.: 16299</returns>
private static string GetCurrentBuildNumber()
{
var regKey = Registry.LocalMachine;
var subKey = regKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
return subKey.GetValue("CurrentBuildNumber").ToString();
}
/// <summary>
/// Get the build lab of the installed operating system.
/// </summary>
/// </summary>
/// <returns>The build lab. E.g.: 16299.431</returns>
private static string GetBuildLab()
{
var regKey = Registry.LocalMachine;
var subKey = regKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
string key = subKey.GetValue("BuildLabEx").ToString();
string value = key.Remove(key.IndexOf(".") + 1);
key = key.Remove(0, key.IndexOf(".") + 1);
value = String.Concat(value, key.Remove(key.IndexOf(".")));
return value;
}
/// <summary>
/// Get the operating system name of the installed operating system.
/// </summary>
/// <returns>The OS name. E.g.: Microsoft Windows 10 Enterprise</returns>
private static string GetOSName()
{
string r = "";
using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"))
{
ManagementObjectCollection information = searcher.Get();
if (information != null)
{
foreach (ManagementObject obj in information)
{
r = obj["Caption"].ToString();
}
}
r = r.Replace("NT 5.1.2600", "XP");
r = r.Replace("NT 5.2.3790", "Server 2003");
}
return r;
}
/// <summary>
/// Get the OS version string of the installed operating system.
/// </summary>
/// <returns>The OS version string. E.g.: Microsoft Windows NT 6.2.9200.0</returns>
private static string GetOSVersionString()
{
return Environment.OSVersion.VersionString;
}
/// <summary>
/// Get the OS version of the installed operating system.
/// </summary>
/// <returns>The OS version. E.g.: 6.2.9200.0</returns>
private static string GetOSVersion()
{
return Environment.OSVersion.Version.ToString();
}
/// <summary>
/// Get the OS architecture of the installed operating system.
/// </summary>
/// <returns>The OS architecture. E.g.: 64-Bit</returns>
private static string GetOSArchitecture()
{
string r = "";
using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"))
{
ManagementObjectCollection information = searcher.Get();
if (information != null)
{
foreach (ManagementObject obj in information)
{
r = obj["OSArchitecture"].ToString();
}
}
}
return r;
}
/// <summary>
/// Get the OS service pack of the installed operating system.
/// </summary>
/// <returns>The OS service pack. E.g.: SP1</returns>
private static string GetOSServicePack()
{
return Environment.OSVersion.ServicePack;
}
/// <summary>
/// Get the OS major version of the installed operating system.
/// </summary>
/// <returns>The OS major version. E.g.: 6</returns>
private static int GetOSMajorVersion()
{
Version ver = Environment.OSVersion.Version;
return ver.Major;
}
/// <summary>
/// Get the OS minor version of the installed operating system.
/// </summary>
/// <returns>The OS minor version. E.g.: 2</returns>
private static int GetOSMinorVersion()
{
Version ver = Environment.OSVersion.Version;
return ver.Minor;
}
/// <summary>
/// Get the OS major revision of the installed operating system.
/// </summary>
/// <returns>The OS major revision. E.g.: 0</returns>
private static int GetOSMajorRevision()
{
Version ver = Environment.OSVersion.Version;
return ver.MajorRevision;
}
/// <summary>
/// Get the OS minor revision of the installed operating system.
/// </summary>
/// <returns>The OS minor revision. E.g.: 0</returns>
private static int GetOSMinorRevision()
{
Version ver = Environment.OSVersion.Version;
return ver.MinorRevision;
}
/// <summary>
/// Get the OS build of the installed operating system.
/// </summary>
/// <returns>The OS build. E.g.: 9200</returns>
private static int GetOSBuild()
{
Version ver = Environment.OSVersion.Version;
return ver.Build;
}
/// <summary>
/// Get the process architecture of the installed operating system.
/// </summary>
/// <returns>The process architecture. E.g.: Win32NT</returns>
private static string GetProcessArchitecture()
{
return Environment.OSVersion.Platform.ToString();
}
#endregion
}
#region Exceptions
public class UnableToReadOSInformationException : ApplicationException
{
public UnableToReadOSInformationException()
{ }
public UnableToReadOSInformationException(string message) : base(message)
{ }
public UnableToReadOSInformationException(string message, Exception inner) : base(message, inner)
{ }
}
public class UnknownErrorException : ApplicationException
{
public UnknownErrorException()
{ }
public UnknownErrorException(string message) : base(message)
{ }
public UnknownErrorException(string message, Exception inner) : base(message, inner)
{ }
}
#endregion
}

View File

@ -0,0 +1,50 @@
<?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>{98F90132-262C-4D6E-B110-572FF383D42B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindowsInfo</RootNamespace>
<AssemblyName>hewininfo</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>false</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="WindowsInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

View File

@ -0,0 +1 @@
f85e13739f45aaa47d7a3cc8c99ffe426aab2f8e88ff1adfebaf718f61dc1e5d

View File

@ -0,0 +1,17 @@
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\WindowsInfo\bin\Debug\WindowsInfo.dll
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\WindowsInfo\bin\Debug\WindowsInfo.pdb
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\WindowsInfo.csproj.CoreCompileInputs.cache
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\WindowsInfo.dll
H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\WindowsInfo.pdb
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\bin\Debug\hewininfo.dll
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\bin\Debug\hewininfo.pdb
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\WindowsInfo.csproj.CoreCompileInputs.cache
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\hewininfo.dll
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\hewininfo.pdb
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\WindowsInfo.csproj.AssemblyReference.cache
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\bin\Debug\hewininfo.dll
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\bin\Debug\hewininfo.pdb
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\WindowsInfo.csproj.AssemblyReference.cache
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\WindowsInfo.csproj.CoreCompileInputs.cache
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\hewininfo.dll
C:\CAD\Git-WorkRepository\VisualStudio\_DLL\WindowsInfo.git\WindowsInfo\obj\Debug\hewininfo.pdb

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.