【问题标题】:Node js windows child process on exit and close eventNode js windows子进程退出和关闭事件
【发布时间】:2016-12-08 10:08:52
【问题描述】:

您好,我正在尝试在关闭calculator.exe 应用程序时调用一个事件,但是在启动应用程序时该事件本身会引发......有什么帮助吗?

var filePath="calc.exe";
var bat = exec(filePath);
bat.on('exit', function() {
 alert("exit");
});

【问题讨论】:

    标签: javascript node.js mean-stack node-webkit


    【解决方案1】:

    尝试将“exit”替换为“SIGINT”:

    bat.on('SIGINT', function() {
     alert("exit");
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-21
      • 1970-01-01
      • 2016-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多