|
//设置参数的最大长度,注意该值必须大于文件的大小
web_set_max_html_param_len("20000");
//获取响应的全部内容,作为文件内容保存
web_reg_save_param("fcontent", "LB=", "RB=", "SEARCH=BODY", LAST);
web_url("viewfile.asp",
"URL=http://www.testage.net/bbs/viewFile.asp?BoardID=25&ID=217",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.testage.net/bbs/dispbbs.asp?boardID=25&ID=5187&page=1",
"Snapshot=t16.inf",
"Mode=HTML",
EXTRARES,
"Url=viewFile.asp?BoardID=25&ID=217", "Referer=http://www.testage.net/bbs/dispbbs.asp?boardID=25&ID=5187&page=1", ENDITEM,
LAST);
//获取响应中的文件长度
flen = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
if(flen > 0)
{
//以写方式打开文件
if((filedes = fopen("c:\\test.rar", "wb")) == NULL)
{
lr_output_message("Open File Failed!");
return -1;
}
//写入文件内容
fwrite(lr_eval_string("{fcontent}"), flen, 1, filedes);
//关闭文件
fclose(filedes);
} |
|