如何查看逻辑内存配置?
private void button1_Click(object sender, EventArgs e)
{
ObjectQuery winQuery = new ObjectQuery("SELECT * FROM Win32_LogicalMemoryConfiguration");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(winQuery);
foreach (ManagementObject item in searcher.Get())
{
textBox1.Text =("Total Space = " + item["TotalPageFileSpace"]);
textBox2.Text = ("Total Physical Memory = " + item["TotalPhysicalMemory"]);
textBox3.Text = ("Total Virtual Memory = " + item["TotalVirtualMemory"]);
textBox4.Text = ("Available Virtual Memory = " + item["AvailableVirtualMemory"]);
}
}
在这段代码中似乎不起作用。并且编译没有错误。