|
问个问题,为什么我用itoa将INT转为字符串但为什么LR总报错,谁能帮我看下。
我知道可以用%d将HttpRetCode打出来,但为什么我转换再打就出问题呢
#include "web_api.h"
Action()
{
int HttpRetCode;
int ret;
char * str1;
web_reg_find("Text/IC=gooGle","SaveCount=go_count","ID=easy to search", LAST);
web_add_cookie("PREF=ID=f87cd5a5457805f7:NW=1:TM=1190189009:LM=1190189009:S=OcTE4JtxbiR89iHx; DOMAIN=www.google.com");
ret=web_url("www.google.com",
"URL=https://www.google.com/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"URL=http://www.google.com/images/nav_logo3.png", "Referer=http://www.google.com/", ENDITEM,
LAST);
if(ret==LR_FAIL)
lr_abort();
if (atoi(lr_eval_string("{go_count}"))>0)
{lr_output_message("find the page");}
else
{lr_error_message("not find the page");}
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
itoa(HttpRetCode,str1,10);
lr_log_message("page loaded , and the http code is %s" , HttpRetCode);
else
lr_log_message("page loaded failed");
return 0;
} |
|