主板序列号C#代码不适用于某些旧计算机 [英] Motherboard Serial Number C# Code not Work for Some Old Computers

查看:142
本文介绍了主板序列号C#代码不适用于某些旧计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了C#2010申请。

我使用主板序列号来注册我的申请。



I have been made C# 2010 Application.
I am using Motherboard Serial number to register my application.

using System.Management;
ManagementObjectSearcher MOS = new ManagementObjectSearcher("Select * From Win32_BaseBoard");
foreach (ManagementObject getserial in MOS.Get())
{
     txtCompanyKey.Text = getserial["SerialNumber"].ToString();
}





它在大多数计算机上运行良好。但有些计算机返回NULL或EMPTY字符串。

我的想法是旧主板无法返回序列号。如果我的想法是真的,请给我一些解决方案。

谢谢



It works very well in most of the computers. But some computers return NULL or EMPTY string.
My idea is that old motherboards cannot return serial Number. If my idea is true or not please give me some solution.
Thanks

推荐答案

这不是真的 - 有些现代人不喜欢要么。

问题是数据不是兼容性所必需的 - 因此不添加它会更便宜,所以所有制造商都不会添加它。



对不起,但你不能单独依赖MB序列号来保证任何安全形式(其他许多人也可以欺骗)
It''s not true - some modern ones don''t either.
The problem is that the data is not "required for compatibility" - so it''s cheaper not to add it, so it doesn''t get added by all manufacturers.

Sorry, but you can''t rely on the MB serial number alone for any form of security (and many of the others can be spoofed as well)


简单的答案是你根本不能依赖这个值来做到这一点。没有解决方案。



您需要做的是找到另一种注册申请的方式。也许您可以收集有关计算机多个部分的信息,然后根据这些值生成哈希值,这样只要其中一个组件存在,您就会得到有效的结果。保存哈希值。



我的个人观点是,将一个软件绑定到特定的机器上绝不是注册应用程序的好方法,所以我建议以完全不同的方式做这件事。



要学习更多内容这个 [ ^ ]文章。
The simple answer is that you simply cannot rely on this value to do this. There is no solution.

What you need to do is find another way to register your application. Perhaps you could gather information on multiple parts of a machine and then generate a hash from those values so that as long as one of those components exist you get a valid result. Save the hash at that point.

My personal perspective is that tying a piece of software down to a specific machine is in no way a good way to register an application, so I would suggest looking to do this in a completely different way.

To learn a little more read this[^] article.


大部分时间都可以使用 [ ^ ],但我担心你会发现它有点麻烦。



另一个选择是寻找 BIO S序列号 [ ^ ],使用 Wmi32_BIOS [ ^ ]



祝你好运

Espen Harlinn
This works most of the time[^], but I''m afraid you''ll find it a bit of a bother.

Another option is to look for the BIOS Serial number[^], using Wmi32_BIOS[^]

Best regards
Espen Harlinn


这篇关于主板序列号C#代码不适用于某些旧计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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