您的位置:首页 > 编程语言 > C#

c# 获取内存信息

2015-11-25 12:29 1406 查看
ManagementObjectSearcher s = new ManagementObjectSearcher(" SELECT * FROM Win32_MemoryDevice");

foreach (ManagementObject mm in s.Get())

{

foreach (PropertyData pd in mm.Properties)

{

//

};

}

-*-----------------------------------

instance of Win32_MemoryDevice

{

Caption = "Memory Device";

CreationClassName = "Win32_MemoryDevice";

Description = "Memory Device";

DeviceID = "Memory Device 0";

EndingAddress
= "2097151";

Name = "Memory Device";

StartingAddress = "0";

SystemCreationClassName = "Win32_ComputerSystem";

SystemName = " ";

};

instance of Win32_MemoryDevice

{

Caption = "Memory Device";

CreationClassName = "Win32_MemoryDevice";

Description = "Memory Device";

DeviceID = "Memory Device 1";

EndingAddress = "4194303";

Name = "Memory Device";

StartingAddress
= "2097152";

SystemCreationClassName = "Win32_ComputerSystem";

SystemName = " ";

};

**********************************************

SELECT * FROM Win32_PhysicalMemory

instance of Win32_PhysicalMemory

{

BankLabel = "BANK 1";

Capacity = "2147483648";

Caption = "Physical Memory";

CreationClassName = "Win32_PhysicalMemory";

DataWidth = 64;

Description = "Physical Memory";

DeviceLocator
= "DIMM1";

FormFactor = 8;

InterleaveDataDepth = 1;

InterleavePosition = 2;

Manufacturer = "0000";

MemoryType = 0;

Name = "Physical Memory";

PartNumber = "SHARETRONIC ";

SerialNumber
= "E5EE0401";

Speed = 1333;

Tag = "Physical Memory 0";

TotalWidth = 64;

TypeDetail = 128;

};

instance of Win32_PhysicalMemory

{

BankLabel = "BANK 2";

Capacity = "2147483648";

Caption = "Physical Memory";

CreationClassName = "Win32_PhysicalMemory";

DataWidth = 64;

Description = "Physical Memory";

DeviceLocator
= "DIMM2";

FormFactor = 8;

InterleaveDataDepth = 1;

InterleavePosition = 1;

Manufacturer = "Kingston";

MemoryType = 0;

Name = "Physical Memory";

PartNumber = "ACR256X64D3U13C9G ";

SerialNumber = "611C4377";

Speed = 1333;

Tag = "Physical Memory 1";

TotalWidth = 64;

TypeDetail = 128;

};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: