Electron 电子获取exe';s的创建日期

Electron 电子获取exe';s的创建日期,electron,Electron,我正在寻找一种方法,从我的electron应用程序中检查外部.exe创建日期 如果有任何提示,我将不胜感激,因为我无法通过谷歌找到任何代码。您可以使用node的fs模块实现您想要的功能。只需使用以下命令: const fs = require('fs'); fs.stat('path-to-exe', (error, stats) => { if (error) { console.log(error); } else { let creationTime =

我正在寻找一种方法,从我的electron应用程序中检查外部.exe创建日期


如果有任何提示,我将不胜感激,因为我无法通过谷歌找到任何代码。

您可以使用node的
fs
模块实现您想要的功能。只需使用以下命令:

const fs = require('fs');
fs.stat('path-to-exe', (error, stats) => {
  if (error) {
    console.log(error);
  }
  else {
    let creationTime = stats.birthtime;
    console.log('Creation time: ', creationTime);
  }
});