如何获取PC唯一ID?
- PC唯一ID是什么?
- 我们怎样才能得到PC的唯一ID呢?
- 是硬盘还是主板的问题?
我想将 PC ID 存储在我的窗口程序中。请分享我。
- What is the PC unique ID?
- How could we get the PC unqiue ID?
- Is it about Hard disk or motherboard?
I'd like to store PC ID in my window program. Please share me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这对我来说很有效,
请参阅此处
This work for me
see here
试试这个,它会从处理器中提取 ID。
Try this, it pulls the ID off the processor.
我假设您想要生成一个机器唯一的 ID。硬盘驱动器可能是最简单的方法,因为其他硬件过于多样化,无法有一套检索其序列号的方法。
最简单的方法可能是使用 Windows 为硬盘驱动器生成的编号。
您可以在 HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices 下找到它
键名是 \DosDevices\C: (假设 C: 驱动器是主系统驱动器 - 在极少数情况下并非如此,但您可以检查系统驱动器是什么并使用适当的键)。
还有另一个与硬盘驱动器相关的数字,称为 UUID,您可以找到脚本来获取该数字。例如: http://www.windowsnetworking.com/articles_tutorials/Deploying -Windows-7-Part18.html 适用于 Windows。或者http://blog.granneman。 com/2007/07/26/find-out-a-hard-drives-uuid/(适用于 Linux)。
我还找到了这篇关于检索主板序列号的文章:获取主板唯一 ID通过vc++编程实现数字
I assume that you want to generate an ID that is unique to the machine. Hard drive is probably the easiest approach because other hardware is too diverse to have a set way of retrieving their serial numbers.
Probably the easiest is to use the number that Windows generates for the hard drive.
You can find it under HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
and the key name is \DosDevices\C: (assuming that the C: drive is the main system drive - which is not the case in some very rare cases, but then you can check for what the system drive is and use the appropriate key).
There's another number associated with Hard drives called UUID and you can find scripts to get that. For example: http://www.windowsnetworking.com/articles_tutorials/Deploying-Windows-7-Part18.html for Windows. Or http://blog.granneman.com/2007/07/26/find-out-a-hard-drives-uuid/ for Linux.
I also found this article on retrieving the motherboard's serial number: Getting motherboard unique ID number thru vc++ programming
“PC唯一ID”通常是指硬件ID,用于唯一标识一台计算机。例如,它们可用于跟踪计算机上软件的使用情况。
根据 这个问题,“主板id、处理器id和BIOS id”“是最不可能改变的”。
此问题包含获取此类信息的代码在 C# 中;不幸的是,我找不到 VB.NET 的任何主题,但它应该很容易移植。
The "PC unique ID" normally means the hardware ID, used to uniquely identify a computer. For example, they can be used to track software use on computers.
According to this question, the "motherboard id, processor id and bios id" "are the least likely to change".
This question contains code to get such information in C#; I couldn't find any topics for VB.NET, unfortunately, but it should be easy to port.
需要
https://www.nuget.org/packages/System.Management/
系统.管理4.7.0
正如您所看到的,有一个“唯一值”加上一些特殊的计算。你可以尽可能地让它变得困难,但逆向工程最终可能会暴露这一点。
计算机 ID 的更好(但更慢)版本(需要 System.Management 导入和引用):
代码:
requires
https://www.nuget.org/packages/System.Management/
System.Management 4.7.0
As you can see there is an "Unique Value" plus some special calculations. You can make this as hard as you can, but reverse engineering can ultimately expose this.
Better (but slower) version for computer ID (requires System.Management import and reference):
Code: