|
参考一下这个例子
char fromPort[128];
char toPort[128];
lr_think_time(38);
web_reg_save_param("outflig",
"LB=<input type=radio checked name=outFlight value=\"",
"RB=\">",
LAST);
web_reg_save_param("inflig",
"LB=<input type=radio checked name=inFlight value=\"",
"RB=\">",
LAST);//Reg 含义是注册,就是说在先注册一下这个函数软后在其后的内容去查找。
strcpy(fromPort,lr_eval_string ("{fromPort}"));
strcpy(toPort,lr_eval_string ("{toPort}"));
while(strcmp(fromPort,toPort)==0){
strcpy(toPort,lr_eval_string ("{toPort}"));
}
lr_start_transaction("注册机票");
web_submit_data("com.mercurytours.servlet.ReservationServlet",
"Action=http://localhost/servlets/com.mercurytours.servlet.ReservationServlet?procSub=1&pg=1",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost/servlets/com.mercurytours.servlet.ReservationServlet",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=tripType", "Value=roundtrip", ENDITEM,
"Name=passCount", "Value=1", ENDITEM,
"Name=fromPort", "Value={fromPort}", ENDITEM,
"Name=fromMonth", "Value=06", ENDITEM,
"Name=fromDay", "Value=12", ENDITEM,
"Name=toPort", "Value={toPort}", ENDITEM,
"Name=toMonth", "Value=06", ENDITEM,
"Name=toDay", "Value=13", ENDITEM,
"Name=servClass", "Value=First", ENDITEM,
"Name=airline", "Value=No Preference", ENDITEM,
"Name=findFlights.x", "Value=52", ENDITEM,
"Name=findFlights.y", "Value=12", ENDITEM,
LAST); |
|