Action()
{
/*********************************
* Author:旺仔
* object:strcmp
* date:2015-12-09
* fuc:我输入一个网址,网址中包含若干参数(ID、password),网址提交后IE返回登录结果(AXZD);返回A代表登录成功,返回X代表登录失败,返回Z和D是其他情况;
***********************************/
//变量定义区
typedef long time_t; //定义一个时间变量
time_t t; //定义一个时间变量
web_reg_save_param(“IsRight”,
“LB=Cache-control: privaternrn”,
“RB=|”,
LAST);
time(&t); //获取当前时间
web_url(“abclogin.asp”,
“URL=http://192.168.1.9/soft/abclogin.asp?U={user}&P={password}&L=0&H=3HS28QKH”,
“Resource=0”,
“RecContentType=text/html”,
“Referer=”,
“Snapshot=t1.inf”,
“Mode=HTML”,
LAST);
lr_output_message(“%s,随机数是%d,”,ctime(&t));
//判断返回值,输入对应日志
if (strcmp(lr_eval_string (“{IsRight}”),”A”) == 0)//如果返回值是A
{
lr_output_message(“success:用户登录成功,返回值是:%s”,lr_eval_string(“{IsRight}”));
}
else if (strcmp(lr_eval_string (“{IsRight}”),”X”) == 0) //如果返回值是X
{
lr_output_message(“failed:用户登录失败,返回值是:%sn”,lr_eval_string(“{IsRight}”));
}
else if (strcmp(lr_eval_string (“{IsRight}”),”Z”) == 0)//如果返回值是Z
{
lr_output_message(“success_others:登录特殊页成功,返回值是:%sn”,lr_eval_string(“{IsRight}”));
}
else //如果返回值是D
{
lr_output_message(“success_free:登录免费用户成功,返回值是:%sn”,lr_eval_string(“{IsRight}”));
}
return 0;
}
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/168075.html原文链接:https://javaforall.cn