如何在没有WMI的情况下获得唯一的机器签名? [英] How to get unique machine signature without WMI?

查看:89
本文介绍了如何在没有WMI的情况下获得唯一的机器签名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,已经有人问过问题关于生成唯一ID的问题一台机器,但我的问题略有不同.

I know that a question has already been asked about generating a unique ID for a machine but my question is slightly different.

我想知道是否还有其他方法(API调用?)来获取硬件信息并且不使用WMI.我从 MSDN 中了解到WMI引入了Win2000,因此它似乎在Win98中不可用.我有一个即使在Win98上也必须运行的应用程序(我知道它很烂,但是您能做什么?)并且仍然掌握硬件信息.

I want to know whether there are any other methods (API calls?) to get hardware information and NOT use WMI. I understand from MSDN that WMI is introduced in Win2000 so it doesnt seem to be available in Win98. I have an application that has to run even on Win98 (I know it sucks but what can you do?) and still get hold of hardware information.

推荐答案

对于许可项目,我已经做过几次了.对于硬盘驱动器序列号,请使用:

I've done this several times for licensing projects. For the hard drive serial number use:

private static extern long GetVolumeInformation(string PathName, StringBuilder VolumeNameBuffer, UInt32 VolumeNameSize, ref UInt32 VolumeSerialNumber, ref UInt32 MaximumComponentLength, ref UInt32 FileSystemFlags, StringBuilder FileSystemNameBuffer, UInt32 FileSystemNameSize);

使用函数返回的VolumeSerialNumber.

此外,您可能已经考虑过使用Windows产品ID(位于HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId).请注意,大量Windows XP用户拥有盗版副本并共享相同的产品密钥.

Also, you may have thought about using the Windows Product ID (Located at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId). Be careful, a large number of Windows XP users have pirated copies and share the same product keys.

这篇关于如何在没有WMI的情况下获得唯一的机器签名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆