用来获取唯一机器ID的实用程序 [英] Utility to get unique machine id

查看:87
本文介绍了用来获取唯一机器ID的实用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在编写一些必须确保只能安装在一台计算机上的软件.计划是让他们下载应用程序.第一次运行该应用程序时,该应用程序将在计算机上找到此唯一值,对其进行编码,并指示客户端将其发送给我们以获取其许可证号.然后,当然,他们给我们的价值将用于构建仅在该计算机上有效的许可证号.

每台机器的唯一值将是最好的,但是我希望在他们的机器上安装Windows(XP)时获得唯一的值.有谁知道我可以使用什么价值?

谢谢n问候,

Hi,

I''m writing some software that I have to ensure can only be installed on one machine. The plan is to have them download the application. The first time the application is ran, the app will find this unique value on the machine, encode it, and instruct the client to send it to us to get their license number. Then, of course, the value they gave us will be used to construct a license number that will only work on that machine.

A unique value per machine would be the best, but I''d settle for a unique value per the installation of windows (XP) on their machine. Does anyone have any idea what value I could use?

Thanks n Regards,

推荐答案

我不主张这样的解决方案. Windows XP曾经做过这样的事情,这完全是a **的痛苦.由于使用了各种与机器相关的位来计算这样的机器标识符,因此该标识符很大程度上取决于当前安装的硬件.例如,如果客户决定安装新设备(或CPU)或替换现有设备,则密码将发生变化,客户将必须请求新的许可证密钥.
我不是要告诉您不要按照您的意图去做,而是要考虑对客户和您的后果. :)
还有其他类似Google之类的方法.他们不会向您出售他们的搜索产品,但您可以购买或租赁某种设备(硬件和软件组合).
为了使我们更轻松地为您提供帮助,您可以详细说明一下您开发的是哪种产品.

最好的问候,

曼弗雷德(Manfred)
I don''t advocate such a solution. Windows XP used to do something like this and it was a total pain in the a**. Since all kind of machine relevant bits were used to calculate such a machine identifier this identifier is very much dependant on the currently installed hardware. If the customer decides to install a new device (or a CPU) for instance or replace an existing one the caculated code would change and the customer would have to request a new license key.
I''m not telling you not to do it the way you intended to, but I''m only saying to consider the consequences for the customer and for you. :)
There are other ways to go like Google for example. They don''t sell you their search product, but you can buy or lease an appliance (HW & SW combination).
To make it easier for us to help you could you elaborate a bit on what kind of product you have developed.

Best Regards,

Manfred


try

{

     string cpuInfo = String.Empty;

     ManagementClass mc = new ManagementClass("Win32_Processor");

     ManagementObjectCollection moc = mc.GetInstances();

     foreach (ManagementObject mo in moc)

    {

          if (cpuInfo == String.Empty)

          {     // only return cpuInfo from first CPU

                cpuInfo = mo.Properties["ProcessorId"].Value.ToString();

          }

    }

     return cpuInfo;

}

catch(Exception ex)

{

      throw new DataStoreUniqueMachineIDException(

     "Error while calculating the unique machine ID.", ex);

}


这篇关于用来获取唯一机器ID的实用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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