交易测试:
系统:xp
协议选择:
web(http/html)
application tyep:Win32 Applications
初始化部分
vuser_init()
{
lr_load_dll("des2.dll");
return 0;
}
运行部分:
Action()
{
char * downs;
char strs[100];
char seq[64];
char sqrb[100];
int te;
char gu[10];
//手工关联
web_reg_save_param("downs",
"LB=SEQ>", "RB=<STAN>", LAST);
//复制字符串到strs
strcpy(strs,lr_eval_string("{numbers}"));
//lr_message("strs=%s",strs);
//直接调用dll中的函数
ClsEncry(strs);
//保存strs为参数,以便后面直接调用
lr_save_string(strs,"sqrb");
//lr_message("the encryped data is :%s",lr_eval_string("{sqrb}"));
web_reg_save_param("mids",
"LB=<MID>", "RB= <DATE>", LAST);
web_reg_save_param("sns",
"LB=<SN>", "RB=<SCR1>", LAST);
lr_start_transaction("down_parameter");
web_custom_request("ClsTrading",
"URL=",
"Method=POST",
"Resource=0",
"RecContentType=text/xml",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTTP",
"EncType=text/xml; charset=utf-8",
"Body=",
LAST);
lr_end_transaction("down_parameter",LR_AUTO);
//lr_output_message("参数是: %s",lr_eval_string("{downs}"));
te=atol(lr_eval_string("{downs}"))+1;
itoa(te,gu,10);
//lr_output_message("t=%s",gu);
lr_save_string(gu,"downs");
//lr_output_message("参数是: %s",lr_eval_string("{downs}"));
//strcat(pp,gu);
//strcat(pp,paraArry);
//lr_message("pp=%s",pp);
lr_start_transaction("100journal");
lr_think_time(15);
lr_rendezvous("journal");
web_custom_request("trading",
"URL=",
"Method=POST",
"Resource=0",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTTP",
"Body=
100{mids}{terminal}1{downs}4000011BBBD7900{sns}{sqrb}",
LAST);
lr_error_message("你的贴号是:%s",lr_eval_string("{numbers}"));
lr_error_message("你选的终端是:%s",lr_eval_string("{terminal}"));
lr_end_transaction("100journal",LR_AUTO);
return 0;
}
阅读(2911) | 评论(0) | 转发(0) |