#include <stdio.h>
#include <iostream>
#include <windows.h>
#include <Urlmon.h>
using namespace std;
int main()
{
//从C盘下载到D盘,并改名为mynona.exe,然后运行
//WinExec("c:\\windows\\notepad.exe",SW_SHOW);
char szUrl[MAX_PATH] = "C:\\windows\\system32\\notepad.exe";
char szFile[MAX_PATH] = "d:\\mynona.exe";
URLDownloadToFile(NULL,szUrl,szFile,0,NULL);
WinExec("d:\\mynona.exe",SW_SHOW);
return 0;
}
#include <iostream>
#include <windows.h>
#include <Urlmon.h>
using namespace std;
int main()
{
//从C盘下载到D盘,并改名为mynona.exe,然后运行
//WinExec("c:\\windows\\notepad.exe",SW_SHOW);
char szUrl[MAX_PATH] = "C:\\windows\\system32\\notepad.exe";
char szFile[MAX_PATH] = "d:\\mynona.exe";
URLDownloadToFile(NULL,szUrl,szFile,0,NULL);
WinExec("d:\\mynona.exe",SW_SHOW);
return 0;
}