当前注册人数107614人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB   站内搜索 BBS讨论社区 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

How To Get Hardware Information (CPU ID, MainBoard Info, Hard Dik Serial, System Information , ...)

读取机器的硬件信息源代码

2007年12月04日
C# 2.0, .NET, Win2K, WinXP, Vista, VS, Dev
本代码可以读取机器的各种硬件数据,比如CPU 序列号,主板,硬盘序列号,硬盘有几个分区,声卡、显卡,网卡,内存设备,系统帐号等等各种系统信息。
 
相关知识

首先,你必须知道这个应用程序的功能是使用System.Management这个类得到的。因此,你需要加上下面的这句话:

using System.Management;

为了获取硬件信息,你还需要创建一个ManagementObjectSearcher 对象。

ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from " + Key);

上面代码的Key是一个将被对应正确的数据填入的值。例如,获取CPU的信息,就需要把Key值设成Win32_Processor

源代码原文下载:
How To Get Hardware Information (CPU ID, MainBoard Info, Hard Disk Serial, System Information , ...) An article to demonstrate how to get system hardware information such as CPU ID, Hard Disk serial number and so on. One of the most efficient ways to do so is to get the CPU ID of the target machine and then, plan your software so that it can just work with the computer that has the same CUP ID. As you very well know, the CPU ID is unique! So, you simply created a lock!

源码图片

从本站下载附件及源代码(1个附件,已经成功下载435次)

最值得关注的外文源代码

An Alternate Way of Writing a Multithreaded GUI in C#
monitor, enable, and disable hardware devices from C#
Seagate Date Code Calculator
Create Icons at Runtime and Show Them in the System Tray
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论96次,此处显示最近20次评论! 查看所有评论

hello  2010年03月05日
学习
zhangjun  2010年03月02日
学习了。非常感谢
zishsh  2010年02月14日
好东西,谢谢分享~
alias  2009年11月27日
读取机器的硬件信息源代码
浩然  2009年09月20日
很好,谢谢了
wyj2004  2009年08月14日
工作正需要,非常谢谢
ogani  2009年07月01日
好东西,谢谢分享~
zxh  2009年06月29日
好东西,谢谢分享~
zxh  2009年06月29日
好东西,谢谢分享~
圆木  2009年06月16日
谢谢分享
Frank  2009年06月11日
希望有个好运气
dotKevin  2009年06月06日
感謝分享
songbo  2009年05月27日
不错的程序,多谢!
Haifeng_1998  2009年05月26日
谢谢分享!!!收藏中!!!
opf110  2009年05月24日
看看吧,呵呵呵,支持一下
shuang_quan  2009年05月09日
太好了
jerry  2009年04月27日
学习
hgy  2009年04月05日
非常感谢
一路走来  2009年03月31日
喜欢好东西
wangmingjian111  2009年03月18日
好东西啊
字数在300字内
请如实评论
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved   免责声明
京ICP备08011023号