随笔分类 - C/C++的测试
摘要:1 #include 2 #include 3 int main(int argc,char *argv[]) 4 { 5 char szCommandLine[] = "cmd"; 6 STARTUPINFO si = { sizeof(si) }; 7 PROCESS_INFORMATION pi; 8 si.dwFlags = STARTF_USESHOWWINDOW; // 指定wShowWindow成员有效 9 si.wShowWindow = TRUE; // 此成员设为TRUE的话则显示新建进程的主窗口10 BOOL bRet = CreateProcess
阅读全文
摘要:1 #include 2 #include 3 #include 4 int execmd(char cmd[],char* result) 5 { 6 char buffer[128]; //定义缓冲区 7 FILE* pipe = _popen(cmd, "r"); //打开管道,并执行命令 8 if (!pipe) return 0; //返回0表示运行失败 9 while(!feof(...
阅读全文

浙公网安备 33010602011771号