TA的每日心情 | 无聊 2016-11-28 17:43 |
---|
签到天数: 6 天 连续签到: 1 天 [LV.2]测试排长
|
- Action()
- {
- long flen; //定义一个整型变量保存获得文件的大小
- long filedes; //保存文件内容
- char file[256]="\0"; //保存文件路径及文件名
- char * chNumber ;
- int time;
- web_set_max_html_param_len("400000000");
- lr_rendezvous("用户集合点");
- web_concurrent_start(NULL);//并发开始
- web_reg_save_param("filecontent",
- "LB/BIN=",
- "RB/BIN=",
- "NotFound=ERROR",
- "Search=Headers",
- LAST);
- web_url("web_url",
- "URL=http://.../app/getFile?filePath=/296a27d0cc455d41ab5746a6ba34daca.zip&fileCategory=package",
- "TargetFrame=",
- "Resource=1",
- "Referer=",
- LAST);
- web_concurrent_end(NULL);
- flen=web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);//获得下载文件大小
- time=web_get_int_property(HTTP_INFO_DOWNLOAD_TIME);//获得下载文件时间
- lr_output_message("下载时间是%d",time);
- chNumber=lr_eval_string("{Random}"); //生成随机数
- strcat(file,"D://test1//");//将下载文件要保存的路径存到test里
- strcat(file,chNumber);//将文件名后自动生成随机数
- strcat(file,".zip");//下载的后缀名
- if(flen > 0)
- {
- if((filedes = fopen(file,"wb")) == NULL)
- {
- lr_output_message("Open FileFailed!", lr_eval_string("{filecontent}"));
- return -1;
- }
- fwrite(lr_eval_string("{filecontent}"),flen,1,filedes );
- fclose( filedes );
- }
- return 0;
- }
复制代码
回放时,报警告
Action.c(43): Warning -26663: Content-Length value is missing or invalid [MsgId: MWAR-26663]
会卡在这里很久,结束提示出错
Error -27496: Internal Error - InternetCloseHandle failed for item at 0334C9B8, Windows error code=6. Assuming the item can be deleted, but error(s) may occur in fvLrwNetWinInetCallback
急觅大神指教~ |
|