惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
量子位
罗磊的独立博客
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
小众软件
小众软件
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
大猫的无限游戏
大猫的无限游戏
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园_首页
博客园 - 叶小钗
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
T
Tailwind CSS Blog
IT之家
IT之家
博客园 - 聂微东
Spread Privacy
Spread Privacy
V2EX - 技术
V2EX - 技术
S
Security Affairs
宝玉的分享
宝玉的分享
V
V2EX
C
Cisco Blogs
博客园 - Franky
美团技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
S
Securelist
J
Java Code Geeks
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
WordPress大学
WordPress大学
W
WeLiveSecurity
T
Threatpost
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志

博客园 - 星期六

C# winform授权:获取cpu和硬盘的序列号,得到机器码 批量替换文本文件中的字符 .net安装部署“Error 1001 在初始化安装时发生异常” 的解决方法 解决.net绘制的 WinForm 在 windows7下变形的方法。 如何使用 Visual C# 加密和解密文件 ppc通过蓝牙与电脑同步时无ActiveSync服务的解决方法。 winfrom中的几个界面皮肤控件 如何弹出一个模式窗口来显示进度条 .net 实现移动控件位置 如何在安装后自动运行程序? 调试自定义操作/安装程序类的方法 利用TimerCallback实现timer传递参数 网页中下载灰鸽子病毒的 SCRIPT 一段控制对象透明度的style. ASP.net 把 DataGrid 数据导出到 Excel . 用C#实现语音技术 ASP.NET 用读取二进制代码的方法在页面上显示指定图片。 c# 8条语句实现屏幕抓图 几条SQLl查询语句
获取主板及硬盘序列号 - 星期六 - 博客园
星期六 · 2010-03-09 · via 博客园 - 星期六

代码

 1 public string getCode()
 2     {
 3       string str = "";
 4       try
 5       {
 6         ManagementClass c2 = new ManagementClass("Win32_BIOS");
 7         foreach (ManagementObject obj2 in c2.GetInstances())
 8         {
 9           str = obj2.Properties["Name"].Value.ToString() + obj2.Properties["Version"].Value.ToString();
10         }
11       }
12       catch (Exception)
13       {
14         str = "bios info is null.";
15       }
16       string str2 = "";
17       try
18       {
19         ManagementClass c3 = new ManagementClass("Win32_DiskDrive");
20         foreach (ManagementObject obj3 in c3.GetInstances())
21         {
22           if (obj3.Properties["Index"].Value.ToString() == "0")
23           {
24             str2 = obj3.Properties["Model"].Value.ToString() + obj3.Properties["Size"].Value.ToString();
25           }
26         }
27       }
28       catch (Exception)
29       {
30         str2 = "disk info is null.";
31       }
32       if (this.cdkey.Length == 12)
33       {
34         this.code = str + str2;
35         this.code = Math.Abs(this.code.GetHashCode()).ToString();
36         this.code = this.code.PadLeft(10'0');
37         this.code = this.code.Substring(37);
38         this.code = this.code + this.getSpCode(this.code);
39         this.code = this.cdkey + this.code;
40       }
41       else if (this.cdkey.Length == 0x10)
42       {
43         this.code = str + str2;
44         this.code = Math.Abs(this.code.GetHashCode()).ToString();
45         this.code = this.code.PadLeft(10'0');
46         this.cdkey = Math.Abs(this.cdkey.GetHashCode()).ToString();
47         this.cdkey = this.cdkey.PadLeft(10'0');
48         this.code = this.code + this.cdkey;
49       }
50       return this.code;
51     }