通过访问硬盘序列号来保护软件
我想获得VB.NET或VB代码来在启动程序时访问硬盘序列号。 它是为了帮助我保护我自己的软件免遭试图盗版的人的侵害。
I want to get the VB.NET or VB code to access the hard disk serial no when starting the program. It's to help me to protect my own software from people who try to pirate copies.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在 C# 中,但你明白了。 为此,您需要使用 System.Management:
正如其他人指出的那样,这可能不是处理此问题的最佳方法。 不过,那是你的事。
In c#, but you get the idea. You'll want to use System.Management for this:
As others have pointed out, this might not be the best way to handle this. However, that's your business.
抱歉,我无法向您提供代码,但我根据我之前在该领域的经验提供了一个警告。
许多许可系统使用的“硬盘序列号”实际上是写在磁盘上的软编号,而不是硬连线到硬件中。
使用“幽灵”软件快速生产许多台式机或使用虚拟化软件快速生产许多服务器的企业通常具有相同的硬盘驱动器标识。
因此,如果您的目标是阻止企业购买一份副本并在许多机器上(可能是无意的)使用它,请务必小心。
I can't offer you the code, sorry, but instead I provide a warning based on my previous experience in the area.
The "Hard Disk Serial No" that was used by a number of licensing systems is actually a soft number that is written on the disk, not hardwired into the hardware.
Enterprises that used "ghosting" software to quickly churn out many desktop machines, or virtualisation software to quickly churn out many servers often had identical Hard Drive identification.
So beware if your goal is to prevent enterprises from buying one copy and using it (perhaps unintentionally) on many machines.
人们经常需要升级/更换硬盘。
最好使用 DMI 中的序列号。
People often need to upgrade/replace their hard disk.
Better to use the serial number from the DMI.
事实上,我已经使用磁盘序列号来保护我的软件。
在vb 6.0中,我们可以创建并使用FileSystemObject。 它允许访问硬盘驱动器的序列号,以及其他几个功能:
请注意,在编写代码之前并声明您必须激活的对象
以下代码提取有关驱动器的一些信息,但您也可以提取驱动器的序列号。
如果您仍然需要它,请在 [电子邮件受保护] 或[电子邮件受保护]。 我会把源代码发给你。
In fact I have used disk serial number for protecting my softwares.
In vb 6.0, we can create and use FileSystemObject. It allows accessing the hard drives' serial numbers, plus several other functions:
Note that prior to writing the code and declaring the object you must activate
The following code extracts some info about the drive but you can also extract the serial number of the drive.
If you still need it, please drop a note to me at [email protected] or [email protected]. I'll send you the source code.
请在下面找到您问题的确切答案:
Please find below the exact answer to your question: