c语言实现后台下载

main函数

#include<stdio.h>

#include<windows.h>

#include<string.h>

#include"tlhelp32.h"

#include<Urlmon.h>

int main()

{

     char *url_Backstage = "http://soft1.xitongzhijia.net:808/201802/Sgsrf_V8.9.0b_XiTongZhiJia.zip";
BackstageDownLoad(url_Backstage);

}

BackstageDownLoad函数

void BackstageDownLoad(char *url)
{
char tmp[MAX_PATH] = {0};
char tmp1[MAX_PATH] = {0};

strcpy(tmp,strrchr(url,'/')+1);
strcpy(tmp1,"C:\\");
strcat(tmp1,tmp);
printf("%s\n",tmp1);
URLDownloadToFile(NULL,url,LoadAddress,0,NULL);
}

猜你喜欢

转载自blog.csdn.net/qq_38611124/article/details/79471323
今日推荐