首页 \ 问答 \ 唯一识别电脑的好方法是什么?(What's a good way to uniquely identify a computer?)

唯一识别电脑的好方法是什么?(What's a good way to uniquely identify a computer?)

我正在开发一些桌面软件以供客户转售。 客户端希望限制软件,以便注册码将专门针对一台计算机。

除了使用来自网卡的MAC之外,还有其他任何技术(可以在Windows和Mac OS X上工作)都可以独特地识别计算机吗?


I'm developing some desktop software for a client to resell. The client wants to restrict the software so that the registration code will be specific to one and only one computer.

Besides using the MAC from the network card, does anyone have any other techniques (that work on both Windows and Mac OS X) for uniquely identifying a computer?


原文:https://stackoverflow.com/questions/671876
更新时间:2021-11-09 13:11

最满意答案

在动态创建脚本元素时, 在将元素插入文档之前,不会加载或执行源文件 。 加载脚本是异步的 。 这意味着您的代码执行以下操作:

  1. 创建脚本元素
  2. 分配源属性
  3. 将元素放入文档中
  4. 开始异步加载源文件
  5. 加载后,执行脚本

编辑:感谢您指出设置async属性对脚本的加载行为没有任何影响。 我从来没有真正使用它,并认为它会工作,但它显然没有。 我删除了声称会这样做的部分。 我做了一个例子来说明这一点


When creating a script element dynamically, the source file will not be loaded or executed before the element has been inserted into the document. Loading of a script is asynchronous. This means your code does the following:

  1. Create the script element
  2. Assign a source attribute
  3. Place the element into the document
  4. Start loading the source file asynchronously
  5. When loaded, execute the script

Edit: Thanks for pointing out that setting the async property does not have any effect on the loading behaviour of scripts. I never actually used it and assumed it would work, but it apparently does not. I removed the part claiming it would. I made an example to show this.

相关问答

更多
  • 在动态创建脚本元素时, 在将元素插入文档之前,不会加载或执行源文件 。 加载脚本是异步的 。 这意味着您的代码执行以下操作: 创建脚本元素 分配源属性 将元素放入文档中 开始异步加载源文件 加载后,执行脚本 编辑:感谢您指出设置async属性对脚本的加载行为没有任何影响。 我从来没有真正使用它,并认为它会工作,但它显然没有。 我删除了声称会这样做的部分。 我做了一个例子来说明这一点 。 When creating a script element dynamically, the source file w ...
  • 代码是否包含在函数中? function test() { setTimeout(...); // code that you cannot modify? } 在这种情况下,可以防止该函数进一步执行,然后再次运行: function test(flag) { if(!flag) { setTimeout(function() { alert(); test(true); }, 5000 ...
  • 只有一种同步加载和执行脚本资源的方法,即使用同步XHR 这是一个如何做到这一点的例子 // get some kind of XMLHttpRequest var xhrObj = createXMLHTTPObject(); // open and send a synchronous request xhrObj.open('GET', "script.js", false); xhrObj.send(''); // add the returned content to a newly created ...
  • 您可以为该函数添加一个“if”语句: