int flen;
int fbody;
//设置最大长度
web_set_max_html_param_len("10000");
lr_rendezvous("1");
//将响应信息存放到fcontent变量
web_reg_save_param("fcontent", "LB=", "RB=", "SEARCH=BODY", LAST);
web_url("test",
"URL=http://192.168.66.19/portal/Client/Resource/1024768_desktop1.jpg",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.66.19/portal/Client/Resource/",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
//获取响应大小
flen = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
if(flen > 0)
{
//以写方式打开文件
if((fbody = fopen("d:\\test.jpg", "wb")) == NULL)
{
lr_output_message("文件操作失败!");
return -1;
}
//写入文件内容
fwrite(lr_eval_string("{fcontent}"), flen, 1, fbody);
//关闭文件
fclose(fbody);
} |