小编R.z*_*ald的帖子

如何在Node Webkit中运行外部exe?

我正在使用Node Webkit作为我的网络应用程序,我真的是使用node webkit的新手.我想在我的应用程序中运行我的exe,但我甚至无法使用'child_process'打开简单的记事本.我在网站上看到了一些例子,但我发现很难运行notepad.exe,请提前帮助并非常感谢.

var execFile = require 
('child_process').execFile, child;

child = execFile('C:\Windows\notepad.exe',
function(error,stdout,stderr) { 
if (error) {
            console.log(error.stack); 
            console.log('Error code: '+ error.code); 
            console.log('Signal received: '+ 
            error.signal);
           } 
console.log('Child Process stdout: '+ stdout);
console.log('Child Process stderr: '+ stderr);
 }); 
child.on('exit', function (code) { 
console.log('Child process exited '+
'with exit code '+ code);
});
Run Code Online (Sandbox Code Playgroud)

此外,我试图使用meadco-neptune插件运行exe并添加插件我把代码放在package.json文件中,但它显示无法加载插件.我的package.json文件是这样的

 {
   "name": "sample",
   "version": "1.0.0",
   "description": "",
   "main": "index.html",
   "window": {
   "toolbar": false,
   "frame": false,
   "resizable": false,
   "show": true,

   "title": " example"
             },
   "webkit": {
   "plugin": true …
Run Code Online (Sandbox Code Playgroud)

webkit exe node.js node-webkit

2
推荐指数
1
解决办法
2733
查看次数

标签 统计

exe ×1

node-webkit ×1

node.js ×1

webkit ×1