原文地址:http://www.cnblogs.com/stray521/archive/2010/08/06/1793647.html

//获取磁盘序列号
try
{
  System.Management.ManagementObjectSearcher cmicWmi = new ManagementObjectSearcher         ( "SELECT * FROM Win32_DiskDrive ");
  System.UInt32 tmpUint32 = 0;
  foreach(ManagementObject cmicWmiObj in cmicWmi.Get())
  {
    tmpUint32 = Convert.ToUInt32(cmicWmiObj[ "signature "].ToString());
  }
  this.textBox1.Text = tmpUint32.ToString();
  this.gProgressBar1.Value ++;
}
catch(Exception ex1)
{
  throw new Exception(ex1.ToString());
}
//获取cpu序列号
try
{
  System.Management.ManagementObjectSearcher Wmi = new ManagementObjectSearcher       ( "SELECT * FROM Win32_Processor ");
  string tmpUint32_1 = string.Empty;
  foreach(ManagementObject WmiObj in Wmi.Get())
  {
    tmpUint32_1 =WmiObj[ "ProcessorId "].ToString();
  }
  this.textBox2.Text = tmpUint32_1;
  this.gProgressBar1.Value ++;
}
catch(Exception ex2)
{
  throw new Exception(ex2.ToString());
}

转:C# 获取磁盘及CPU的序列号的更多相关文章

  1. C#-获取磁盘,cpu,内存信息

    获取磁盘信息 zongdaxiao = GetHardDiskSpace("C") * 1.0 / 1024; user = GetHardDiskFreeSpace(" ...

  2. 如何获取多核、多cpu系统中指定cpu的序列号

    如何获取多核.多cpu系统中指定cpu的序列号作者:SkyJacker(转贴请保持完整并注明作者和出处)http://www.cnpack.orgCnPack IV  QQ Group: 130970 ...

  3. 用C++和shell获取本机CPU、网卡IO、内存、磁盘等的基本信息

    用C++和shell获取本机CPU.网卡.内存.磁盘等的基本信息: 由于对C++相关的函数没多少了解,但是觉得用shell反而相对简单一些: 一.shell脚本,用来辅助C++获取主机的资源使用信息 ...

  4. 通过WMI - Win32_Processor - ProcessorId获取到的并不是CPU的序列号,也并不唯一

    现在网上不少教程,教人通过WMI - Win32_Processor - ProcessorId来获取CPU的“序列号”,典型代码如下: public static string GetCPUSeri ...

  5. Linux 下PHP获取服务器状态CPU、MEM使用率、磁盘使用率、IP地址获取、MAC地址获取等信息记录

    获取服务器状态记录使用的是SHELL命令方式进行获取输出结果  然后进行字符串拆分处理等方式进行获取到自己有用信息 贴出获取方式以及常用处理方式 <?PHP $fp = popen('执行SHE ...

  6. [No0000112]ComputerInfo,C#获取计算机信息(cpu使用率,内存占用率,硬盘,网络信息)

    github地址:https://github.com/charygao/SmsComputerMonitor 软件用于实时监控当前系统资源等情况,并调用接口,当资源被超额占用时,发送警报到个人手机: ...

  7. Java获取Linux系统cpu使用率

    原文:http://www.open-open.com/code/view/1426152165201 import java.io.BufferedReader; import java.io.Fi ...

  8. php获取linux服务器CPU、内存、硬盘使用率的实现代码

    define("MONITORED_IP", "172.16.0.191"); //被监控的服务器IP地址 也就是本机地址 define("DB_SE ...

  9. 获取网卡MAC、硬盘序列号、CPU_ID、BIOS编号

    抄来的 获取网卡MAC.硬盘序列号.CPU ID.BIOS编号 本文中所有原理及思想均取自网络,有修改.其中获取硬盘序列号.获取CPU编号.获取BIOS编号的原始代码的著作权归各自作者所有. 以下代码 ...

随机推荐

  1. Matrix对bitmap的一些操作

    本篇文章是对使用Matrix对bitmap的旋转与镜像水平垂直翻转进行了详细的分析介绍,需要的朋友参考下  Bitmap convert(Bitmap a, int width, int height ...

  2. C# 反射类型转换

    /// <summary> /// 泛型类型转换 /// </summary> /// <typeparam name="T">要转换的基础类型 ...

  3. Jquery Mobile 百度地图 Demo

    首先非常感谢franck分享的Demo! Demo截图: 下面是franck对此Demo的说明: 原理:1.通过百度拾取坐标系统获得点位的坐标. http://api.map.baidu.com/lb ...

  4. CodeForces 176B Word Cut dp

    Word Cut 题目连接: http://codeforces.com/problemset/problem/176/C Description Let's consider one interes ...

  5. Codeforces Educational Codeforces Round 5 E. Sum of Remainders 数学

    E. Sum of Remainders 题目连接: http://www.codeforces.com/contest/616/problem/E Description The only line ...

  6. [MEAN Stack] First API -- 1. with Node.js, Express and MongoDB

    Learn how to import data into your MongoDB and then use Express to serve a simple Node.js API. Impor ...

  7. TCP/IP数据包结构具体解释

    [关键词] TCP IP 数据包 结构 具体解释 网络 协议 一般来说,网络编程我们仅仅须要调用一些封装好的函数或者组件就能完毕大部分的工作,可是一些特殊的情况下,就须要深入的理解 网络数据包的结构, ...

  8. 转:《JavaScript—之对象参数的引用传递》

    转自:博客园 Wayou http://www.cnblogs.com/Wayou/p/javascript_arguments_passing_with_reference.html 变量 1.Ja ...

  9. Apache Shiro 使用手册---转载

    原文地址:http://www.360doc.com/content/12/0104/13/834950_177177202.shtml (一)Shiro架构介绍 一.什么是Shiro Apache ...

  10. iOS获取设备型号

    导入头文件 #include <sys/types.h> #include <sys/sysctl.h> 直接调用 //获得设备型号 + (NSString *)getCurr ...