|
用web_submit_data函数就能做了
Action()
{
lr_start_transaction("login");//开始事务
//获取登录成功状态为1
web_reg_find("TEXT=1","SaveCount=Num_Count",
LAST);
//登录
web_submit_data("login",
"Action=http://192.168.1.150:8080/dataclient/sys/user/login",
"Method=POST",
"TargetFrame=",
"RecContentType=http",
"Mode=HTTP",
ITEMDATA,
"Name=userName", "Value=admin", ENDITEM,
"Name=userPassword", "Value=123456", ENDITEM,
LAST);
//检查结果
if (atoi(lr_eval_string("{Num_Count}")) > 0)
lr_end_transaction("login",LR_PASS);
else
lr_end_transaction("login",LR_FAIL);
return 0;
}
这个是我以前从网上找的也实践过了,拿去不谢 |
|