Príklad v c#:
using System; using System.Management; namespace ConsoleApp1 { class Program { static void Main(string[] args) { WqlObjectQuery wqlQueryComputerSystemProduct = new WqlObjectQuery("SELECT * FROM Win32_ComputerSystemProduct"); ManagementObjectSearcher searcher = new ManagementObjectSearcher(wqlQueryComputerSystemProduct); foreach (ManagementObject product in searcher.Get()) { Console.WriteLine($"identifyingNumber : {product["IdentifyingNumber"]}"); Console.WriteLine($"name : {product["Name"]}"); } WqlObjectQuery wqlQueryComputerSystem = new WqlObjectQuery("SELECT * FROM Win32_ComputerSystem"); ManagementObjectSearcher searcher2 = new ManagementObjectSearcher(wqlQueryComputerSystem); foreach (ManagementObject item in searcher2.Get()) { Console.WriteLine($"ramCapacity : {item["TotalPhysicalMemory"]}"); } WqlObjectQuery wqlQueryOperatingSystem = new WqlObjectQuery("SELECT * FROM Win32_OperatingSystem"); ManagementObjectSearcher searcher3 = new ManagementObjectSearcher(wqlQueryOperatingSystem); foreach (ManagementObject manObject in searcher3.Get()) { Console.WriteLine($"Name : {manObject["name"]}"); Console.WriteLine($"Version : { manObject["version"]}"); Console.WriteLine($"Manufacturer : { manObject["Manufacturer"]}"); Console.WriteLine($"Computer Name : {manObject["csname"]}"); Console.WriteLine($"Windows Directory : { manObject["WindowsDirectory"]}"); } Console.ReadKey(); } } }