免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6870 | 回复: 12
打印 上一主题 下一主题

如何根据计算机硬件生成唯一的串号或序列号?--已解决 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-03-14 23:48 |只看该作者 |倒序浏览
本帖最后由 iamlimeng 于 2010-04-06 17:00 编辑

想开发一个程序,可以根据使用者的计算机硬件配置生成一个唯一的串号或序列号,就象很多软件的机器码那样。

不知道有没有相关模块,知道的大虾给个方案,非常感激!

(只需在微软WINDOWS平台能实现就可以了)

论坛徽章:
0
2 [报告]
发表于 2010-03-15 10:04 |只看该作者
取得计算机某一方面的物理特征,比如MAC地址,然后用之作为key,生成一个加密串。
http://search.cpan.org/~mthurn/N ... Address/Ethernet.pm

论坛徽章:
0
3 [报告]
发表于 2010-03-15 10:12 |只看该作者
谢谢仙子姐姐,我认真看一下,搞定了把结果贴上来。

论坛徽章:
0
4 [报告]
发表于 2010-03-15 11:27 |只看该作者
MAC地址也是可以修改的.
試下 UUID

论坛徽章:
0
5 [报告]
发表于 2010-03-15 11:50 |只看该作者
我看了仙子提供的包,不能满足我的要求。

我希望能综合两三个核心硬件信息,生成一个机器码,单纯地以MAC地址作为依据,不是太可靠,再说如楼上兄弟所说,MAC是可以修改的。

论坛徽章:
0
6 [报告]
发表于 2010-03-15 20:00 |只看该作者
回复 1# iamlimeng

using perl->WMI: Win32_ComputerSystem read CPU's Property:
    ProcessorId, Value: AFE9F9FF000006D8
to get unique ID.

论坛徽章:
0
7 [报告]
发表于 2010-03-15 20:10 |只看该作者
本帖最后由 x9x9 于 2010-03-15 20:12 编辑

好像有些是利用硬盘的序列号加密的~

http://www.google.cn/search?hl=z ... g2&aql=&oq=

还有这个cpu的:

http://bbs.chinaunix.net/redirec ... 1&goto=lastpost

论坛徽章:
0
8 [报告]
发表于 2010-04-04 23:26 |只看该作者
回复 6# ulmer

问题解决了,是在Win32_Processor类中。非常感谢!

论坛徽章:
0
9 [报告]
发表于 2010-04-04 23:49 |只看该作者
回复 7# x9x9

谢谢提供资料,问题已解决。

论坛徽章:
0
10 [报告]
发表于 2010-04-04 23:50 |只看该作者
贴出来与大家共享:
  1. #!/usr/bin/perl

  2. use strict;
  3. use Win32::OLE qw(in);
  4. use Win32::OLE::Variant;

  5. my $strComputer = '.';
  6. my $objWMIService = Win32::OLE->GetObject('winmgmts:' .
  7.     '{impersonationLevel=impersonate}!\\\\' . $strComputer .
  8.     '\\root\\cimv2');
  9. my $wql = 'SELECT * FROM Win32_Processor';
  10. my $results = $objWMIService->ExecQuery($wql);
  11. print "The Processor Information of this computer is as follows:\n\n";
  12. foreach my $obj (in $results) {
  13.     print "Manufacturer : ", $obj->Manufacturer, "\n";
  14.     print "Name         : ", $obj->Name, "\n";
  15.     print "ProcessorId  : ", $obj->ProcessorId, "\n";
  16.     print "UniqueId     : ", $obj->UniqueId, "\n";
  17.     print "Version      : ", $obj->Version, "\n";
  18.     print "Description  : ", $obj->Description, "\n";
  19.     print "DeviceID     : ", $obj->DeviceID, "\n";
  20.     print "MaxClockSpeed: ", $obj->MaxClockSpeed, "\n";
  21.     print "LogProcessors: ", $obj->NumberOfLogicalProcessors, "\n";
  22.     print "ProcessorType: ", $obj->ProcessorType, "\n";
  23.     print "VoltageCaps  : ", $obj->VoltageCaps, "\n";
  24. }

  25. <STDIN>;
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP