Action()
{
char *str1;//=(char*)malloc(20);
char str2[10];
web_url("toLoginPage",
"URL={Url}/login",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer={Url}/index",
"Snapshot=t3.inf",
"Mode=HTML",
EXTRARES,
"Url=/images/sprites_login.png", ENDITEM,
"Url=/images/login_ico.jpg", ENDITEM,
LAST);
lr_start_transaction("立刻登录");
web_submit_data("login.action",
"Action={Url}/login/userLogin",
"Method=POST",
"TargetFrame=",
"RecContentType=text/json",
"Referer={Url}/toLoginPage",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=userName", "Value={username}", ENDITEM,
"Name=password", "Value={password}", ENDITEM,
"Name=autosession", "Value=false", ENDITEM,
"Name=verify", "Value=请输入验证码", ENDITEM,
"Name=_GLOBAL_SESSION_DUPLICATE_SWITCH", "Value=true", ENDITEM,
"Name=_GLOBAL_REQUEST_DUPLICATE_KEY", "Value={duplicate_key}", ENDITEM,
//关联信息 "Value=eecf72ec-c866-4beb-8d96-b04215ecd72a"
"Name=_GLOBAL_SUBMIT_TYPE_KEY", "Value=ajax", ENDITEM,
LAST);
str1=lr_eval_string("{username}");
strncpy(str2,str1,3);
lr_output_message("str2= %s",str2);
lr_save_string(str2,"str_name");
web_reg_find("Fail=NotFound","Search=All",
"SaveCount=Counts",
"Text={str_name}**!",
LAST);
web_url("index",
"URL={Url_1}/index",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t78.inf",
"Mode=HTML",
LAST);
lr_output_message("user:%s",lr_eval_string("{username}"));
lr_end_transaction("立刻登录",LR_AUTO);
return 0;
}