执行程序的两种方法:

来源:互联网 发布:origin怎么保存数据 编辑:程序博客网 时间:2024/06/05 10:16

执行程序的两种方法:


  sprintf_s(lastFileName,2048,"%s -P %s -t 1 -c %s",T2A(filePathWget),strImageListPath,backFileName);/*-t,tried one times;-c continue with range;argv[2],url*/

  printf("%s\n",lastFileName);


  WinExec(lastFileName,SW_HIDE);


  //sprintf_s(lastFileName,2048,".\\wget.exe -t 1 -c %s",argv[2]);
  sprintf_s(lastFileName,2048," -P %s -t 1 -c %s",strImageListPath/*CLIENTIMAGELIST*/,downFileName);
  //printf("%d\n%s\n",argc,lastFileName);
  ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
  ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS ;
  ShExecInfo.hwnd = NULL;
  ShExecInfo.lpVerb = NULL;
  ShExecInfo.lpDirectory = NULL;
  ShExecInfo.nShow = SW_HIDE;
  ShExecInfo.hInstApp = NULL; 
  ShExecInfo.lpFile = T2A(filePathWget);
  ShExecInfo.lpParameters = lastFileName; 
  ShellExecuteExA(&ShExecInfo);
  int k = GetLastError();

0 0
原创粉丝点击