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;
};
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;
};
相关文章推荐
- c# 获取主板信息
- 如何使用免费控件将word表格中的数据导入到excel中
- c#StreamWriter,StreamReader类(主要用于文本文件访问)
- C#实现简单过滤非法字符实例
- C# WinForm程序退出的方法
- C#中 += (s, e) => 这些字符什么意思
- 【NCRE项目】C#实现TabControl切换打开不同文件夹
- c# 子线程锁中调用主线程死锁
- C#获取局域网ip
- C# #if DEBUG
- 轻松学习C#的属性
- 轻松学习C#的哈希表
- C# 文本与byte互转
- C# 将文件转化成byte[]数组
- C#实现流程图设计器
- C#调用WebService服务(动态调用)
- C#使用插件生成二位码
- C# 强制关闭当前程序进程(完全Kill掉不留痕迹)
- 【C#】校验IP地址的正则表达式
- C#里的时间戳