using System;
using System.Management;
Code:
static void Main(string[] args)
{
WqlObjectQuery query = new WqlObjectQuery("SELECT * FROM Win32_PerfFormattedData_PerfOS_Memory");
ManagementObjectSearcher find = new ManagementObjectSearcher(query);
//Traverse each management object.
foreach (ManagementObject mo in find.Get())
{
Console.WriteLine("Available bytes: " + mo["AvailableBytes"]);
Console.WriteLine("Available KBs: " + mo["AvailableKBytes"]);
Console.WriteLine("Available MBs: " + mo["AvailableMBytes"]);
Console.WriteLine("Cache bytes: " + mo["CacheBytes"]);
Console.WriteLine("Cache bytes peak: " + mo["CacheBytesPeak"]);
Console.WriteLine("Cache bytes: " + mo["CacheBytes"]);
Console.WriteLine("Commit limit: " + mo["CommitLimit"]);
Console.WriteLine("Committed bytes: " + mo["CommittedBytes"]);
Console.WriteLine("Free system page table entries: " + mo["FreeSystemPageTableEntries"]);
Console.WriteLine("Pool paged bytes: " + mo["PoolPagedBytes"]);
Console.WriteLine("System code total bytes: " + mo["SystemCodeTotalBytes"]);
Console.WriteLine("System driver total bytes: " + mo["SystemDriverTotalBytes"]);
}
}
0 comments:
Post a Comment