Ruft den Namen, Version, Hersteller, Computernamen, und das Betriebssystem - Verzeichnis ab per WMI ab.
using System.Management;
string OS_Name;
string Version;
string Hersteller;
string Computer_Name;
string Windows_Directory;
ManagementObjectSearcher OS = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");
ManagementObjectCollection queryCollection1 = OS.Get();
foreach (ManagementObject mo in queryCollection1)
{
OS_Name = mo["name"].ToString();
Version = mo["version"].ToString();
Hersteller = mo["Manufacturer"].ToString();
Computer_Name = mo["csname"].ToString();
Windows_Directory = mo["WindowsDirectory"].ToString();
}
Kommentare zum Snippet