• nodejs 调用进程


    #include <iostream>
    using namespace std;
    
    int _tmain(int argc, _TCHAR* argv[])
    {
        cout<<_T("输入一行---->")<<endl;
        char str[30];
        cin.getline(str, 30);
        cout << str << endl;
        cout << "输入第2行---->" << endl;
        cin.getline(str, 30);
        cout << str << endl;
        cout << "输入第3行---->" << endl;
        cin.getline(str, 30);
        cout << str << endl;
        return 0;
    }

    参考

    https://www.imooc.com/wenda/detail/528299

    调用通讯

    var cp = require('child_process');
      //spawn
      var ls = cp.spawn('ConsoleApplication1.exe'/*command*/, [/*'3s.mp4']*//*args*/, {}/*options, [optional]*/);
      ls.stdout.on('data', function (data) {
        console.log('stdout: ' + data);
        ls.stdin.write('1112 4
    '); 
      });
     
      ls.stderr.on('data', function (data) {
        console.log('stderr: ' + data);
      });
     
      ls.on('exit', function (code) {
        console.log('child process exited with code ' + code);
      });
  • 相关阅读:
    112.路径总和
    二叉树的中序遍历
    HTML基础及案例
    web概念概述
    Spring JDBC
    数据库连接池
    JDBC连接池&JDBCTemplate
    JDBC
    MySQL多表&事务
    DCL
  • 原文地址:https://www.cnblogs.com/cnchengv/p/14764910.html
Copyright © 2020-2023  润新知