|
#include "web_api.h"
#include "lrw_custom_body.h"
vuser_init()
{
web_add_cookie("username=enpo; DOMAIN=88.148.0.133");
web_url("jh",
"URL=http://88.148.0.133:7001/jh/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_submit_form("login.do;jsessionid=DGqvsmYDVSpC62B12xhrz70Y2LW82vJsjQ3Byjv5dHLPbBzcmNsV!-1895023105",
"Snapshot=t2.inf",
ITEMDATA,
"Name=formvalue(username)", "Value={UName}", ENDITEM,
"Name=formvalue(password)", "Value={pwd}", ENDITEM,
"Name=formvalue(saveme)", "Value=<OFF>", ENDITEM,
LAST);
//将当前用户赋值给变量"MY_name"
lr_save_string(lr_eval_string("{UName}"), "MY_name");
lr_output_message("当前登录的用户是:%s",lr_eval_string("{MY_name}"));
//搜索当前登录用户名
web_find("my find",
"expect=notfound",
"matchcase=no",
"onfailure=abort",
"report=failure",
"repeat=no",
"what={MY_name}",
LAST);
// lr_vuser_status_message("当前用户史称是是:%s",lr_eval_string("{pwd}"));
lr_vuser_status_message("密码是:%s",lr_eval_string("{pwd}"));
return 0;
} |
|