C#得到CPU的序列号、硬盘序列号、网卡序列号
2009-01-19 10:09
357 查看
C#得到CPU的序列号、硬盘序列号、网卡序列号
//得到cpu信息public static void GetCpuIndex()
{
string _cpuInfo = "";
ManagementClass cimobject = new ManagementClass("Win32_Processor");
ManagementObjectCollection moc = cimobject.GetInstances();
foreach (ManagementObject mo in moc)
{
_cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
}
return _cpuInfo;
}
// 得到硬盘序列号
public static void GetHDIndex()
{
string _HDInfo = "";
ManagementClass cimobject1 = new ManagementClass("Win32_DiskDrive");
ManagementObjectCollection moc1 = cimobject1.GetInstances();
foreach (ManagementObject mo in moc1)
{
_HDInfo = (string)mo.Properties["Model"].Value;
}
retrun _HDInfo;
}
//获取网卡硬件地址
public static void GetMacAddress()
{
string _MacAddress = "";
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc2 = mc.GetInstances();
foreach (ManagementObject mo in moc2)
{
if ((bool)mo["IPEnabled"] == true)
MacAddress = mo["MacAddress"].ToString();
mo.Dispose();
}
return _MacAddress;
}
相关文章推荐
- C#得到CPU的序列号、硬盘序列号、网卡序列号
- C#得到CPU的序列号、硬盘序列号、网卡序列号
- C#应用:获取cpu序列号,硬盘ID,网卡MAC地址
- 用C#获取硬盘序列号,CPU序列号,网卡MAC地址
- c#中获取cpu序列号、网卡mac地址、ip地址、硬盘序列号、登录用户名、pc类型、计算机名称、物理内存
- C# 获取CPU序列号、网卡MAC地址、硬盘序列号封装类,用于软件绑定电脑
- C#获取cpu序列号,硬盘ID,网卡MAC地址
- C#应用:获取cpu序列号,硬盘ID,网卡MAC地址
- 用C#获取硬盘序列号,CPU序列号,网卡MAC地址
- c#中获取cpu序列号、网卡mac地址、ip地址、硬盘序列号、登录用户名、pc类型、计算机名称、物理内存 【转载】
- 用C#获取硬盘序列号,CPU序列号,网卡MAC地址
- C#获取硬盘、CPU、主板、网卡的序列号
- C#获取CPU序列号、网卡MAC地址、硬盘序列号封装类
- C#中获取CPU序列号、网卡Mac地址、IP地址、硬盘序列号、登录用户名、PC类型、计算机名称、物理内存
- C#获取cpu序列号,硬盘ID,网卡MAC地址
- C#获取硬盘序列号,CPU序列号,网卡MAC地址
- C#中获取CPU序列号、网卡Mac地址、IP地址、硬盘序列号、登录用户名、PC类型、计算机名称、物理内存
- c#中获取cpu序列号、网卡mac地址、ip地址、硬盘序列号、登录用户名、pc类型、计算机名称、物理内存
- C#获取硬盘、CPU、主板、网卡的序列号…… ManagementObjectSearcher
- C#获取cpu序列号,硬盘ID,网卡MAC地址