#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <sstream>ios
std::string get_cmd_result(const std::string& str_cmd)
{
std::stringstream ss;
FILE* pf = NULL;get
if ((pf = _popen(str_cmd.c_str(), "r")) == NULL){
return "";
}cmd
char buf[10] = { 0 };
while (fgets(buf, sizeof(buf), pf)){
ss << buf;
}string
_pclose(pf);io
std::string str_result = ss.str();
return str_result;
}stream
int main()
{di
std::string cmd = "wmic process get name,processid|findstr YoudaoNote.exe";process
std::string ret = get_cmd_result(cmd);
}while