|
2#
楼主 |
发表于 2010-11-3 10:14:18
|
只看该作者
没人回复。。。
不过已经找到解决方案了。发出来供大家学习
Action()
{
int iflen;
long ifbody;
//strncpy(tempstr2,strtmp,2);
//lr_output_message( tempstr2=%s,tempstr2);
lr_rendezvous("登陆");
lr_think_time(10);
web_set_user("tgms\\{user}",
lr_decrypt("{pass}"),
"192.0.1.124:80");
web_reg_save_param("imgURL" , "LB=src=\"" , "RB=\"" ,"Search=body", LAST);
web_reg_save_param ("fcontent" , "LB=" , "RB=" , "SEARCH=BODY" , LAST);
/* Request with GET method to URL "http://192.0.1.124/gisrct/data.asp?clientMapWidth=822&clientMapHeight=414" failed during recording. Server response : 401*/
web_url("data.asp",
"URL=http://192.0.1.124/gisrct/data.asp?clientMapWidth=822&clientMapHeight=414",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
"Url=images/TGMS.gif", "Referer=http://192.0.1.124/gisrct/data.asp?clientMapWidth=822&clientMapHeight=414", ENDITEM,
"URL={imgURL}", "Referer=http://192.0.1.124/gisrct/data.asp?clientMapWidth=822&clientMapHeight=414", ENDITEM,
"Url=images/pixel.gif", "Referer=http://192.0.1.124/gisrct/data.asp?clientMapWidth=822&clientMapHeight=414", ENDITEM,
LAST);
web_set_max_html_param_len("10000");
iflen =web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
lr_output_message("Start ");
if (iflen>0)
{
char filename [255] = "c:\\";
char *tmpName = lr_eval_string("{imgURL}");
int i = strlen(tmpName);
char outputbuf[10]={'\0'};
for(;i>=0;i--)
{
if( tmpName[i-1]=='/')
{
break;
}
}
// i = strrchr(tmpName,'/');
// sprintf(outputbuf,"i = %d",i);
// lr_output_message(outputbuf);
strcat(filename,tmpName+i);
//strcat(filename,lr_eval_string("{imgURL}"));
lr_output_message(filename);
if ((ifbody=fopen (filename ,"wb"))==NULL)
{
lr_output_message("文件操作失败");
return - 1;
}
lr_output_message("Start Save file");
fwrite (lr_eval_string ("{fcontent}"),iflen , 1 , ifbody) ;
lr_output_message("Stop Save file");
fclose(ifbody);
}
if (iflen=0)
{
lr_output_message("length is 0");
} |
|