简体   繁体   English

通过硬件信息创建电子原子应用程序

[英]create electron atom application via hardware information

I need to create a desktop application. 我需要创建一个桌面应用程序。 Since lately I 've been using constantly javascript for my mobile html5 apps I was thinkning of using electron atom (former Atom Shell) to develop the desktop one. 自从最近以来,我一直在为移动html5应用程序不断使用javascript,我一直在考虑使用电子原子(以前的Atom Shell)开发台式机。

The problem is that my client needs to be able to lock his application using hardware information like motherboard serial number or cpu id. 问题是我的客户需要能够使用硬件信息(如主板序列号或CPU ID)锁定其应用程序。

This is quite easy using usual desktop dev languages like c++, java etc 使用常用的桌面开发语言(如c ++,java等),这非常容易

Can you imagine a way of fetching such information using javascript frameworks like electron atom? 您能想象一种使用诸如电子原子之类的javascript框架来获取此类信息的方法吗?

For example cordova allows to develop plugins (using java for example for android apps). 例如cordova允许开发插件(例如,对于Android应用程序,使用Java)。 Is there something similar in electron atom. 电子原子中是否有类似的东西。

That UUID is the best way to ID a machine, it exists in Windows, Mac and many other platforms. UUID是识别机器的最佳方法,它存在于Windows,Mac和许多其他平台中。 It is a 32 characters in length, universally unique identifier. 它是一个32个字符的长度,普遍唯一的标识符。 You can run the above wmic command to get it. 您可以运行上面的wmic命令来获取它。

You can make this using npm module called machine-uuid ( https://www.npmjs.com/package/machine-uuid ) 您可以使用称为machine-uuidhttps://www.npmjs.com/package/machine-uuid )的npm模块进行此操作

require("machine-uuid")(function(uuid) {
  console.log(uuid)
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM