目的:使用随机字符串拼接引用,实现对bbs注册接口压测
//随机生成字符串 int itera_num,rand_num,i; char i_name[24]=""; char StrTable[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; ..........省略................... for (i=0;i<=8;i++) { rand_num=rand()%62; strncat(i_name,StrTable+rand_num,1); } lr_save_string(i_name,"i_name_value"); lr_log_message("i_name== %s", i_name); //i_name_value即为可传入参数 lr_log_message("i_name_value== %s", lr_eval_string("{i_name_value}")); //将i_name_value引入到names即可 web_submit_data("member.php", "Action=http://www.limlhome.cn/bbs/member.php?mod=register&inajax=1", "Method=POST", "EncType=multipart/form-data", "TargetFrame=", "RecContentType=text/xml", "Referer=http://www.limlhome.cn/bbs/member.php?mod=register", "Snapshot=t9.inf", "Mode=HTML", ITEMDATA, "Name=regsubmit", "Value=yes", ENDITEM, "Name=formhash", "Value={formhash}", ENDITEM, "Name=referer", "Value=http://www.limlhome.cn/bbs/forum.php", ENDITEM, "Name=activationauth", "Value=", ENDITEM, "Name=FSJkhH", "Value={i_name_value}", ENDITEM, "Name=hDALC8", "Value=123456", ENDITEM, "Name=QmMt8M", "Value=123456", ENDITEM, "Name=RELb5r", "Value={email}@qq.com", ENDITEM, LAST);
标签:生成,char,num,随机,字符串,引用 From: https://www.cnblogs.com/test22/p/17768875.html