Action()
{ int flen;
long filedes;
char file[256]="\0";
char fuzhi[10]="\0";
char * chNumber=fuzhi;
//设置参数的最大长度,注意该值必须大于文件的大小
web_set_max_html_param_len("2000000");
web_url("cyrj.php",
"URL=http://s81a19/2_soft/cyrj.php",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=../image/home_title_r1_c3_03.gif", "Referer=http://s81a19/admin.php", ENDITEM,
LAST);
chNumber=lr_eval_string("{suiji}");
strcat(file,"f:\\win");
strcat(file,chNumber);
strcat(file,"zip81.exe");
//获取响应的全部内容,作为文件内容保存
web_reg_save_param("fcontent", "LB=", "RB=", "SEARCH=BODY", LAST);
lr_start_transaction("down");
web_url("Winzip 8.1",
"URL=http://s81a19/2_soft/cyrj/winzip81.exe",
"TargetFrame=",
"Resource=0",
"RecContentType=application/octet-stream",
"Referer=http://s81a19/2_soft/cyrj.php",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);
//获取响应中的文件长度
flen = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
if(flen > 0)
{
//以写方式打开文件
if((filedes = fopen(file, "wb")) == NULL)
{
lr_output_message("Open File Failed!");
return -1;
}
//写入文件内容
fwrite(lr_eval_string("{fcontent}"), flen, 1, filedes);
//关闭文件
fclose(filedes);
}
lr_end_transaction("down",LR_AUTO);
return 0;
}
公司论坛上的一个下载常用软件的链接地址,测试用的。
备自己日后查找用