浏览 2515 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2009-08-04
用LR+DLL这个方法是很可行的。 Init int id, scid; char *vuser_group; vuser_init() { lr_whoami(&id, &vuser_group, &scid); srand(id*scid*time()); lr_load_dll("iceclient_stresstest.dll"); Initialize("userService:default -h 10.2.224.242 -p 10002",1); return 0; } char params[1024]; int rt = 0; char longId[32]; char nickname[32]; Action() { sprintf(nickname,"memUdb_%dx%dx%d",rand()%1000,rand()%1000,rand()%1000); switch(rand()%3){ case 0: sprintf(longId,"cntaobao%s",nickname); break; case 1: sprintf(longId,"cnalichn%s",nickname); break; case 2: sprintf(longId,"wangwang%s",nickname); } lr_save_string(nickname,"nickname"); lr_save_string(longId,"longId"); memset(params,0,1024); strcat(params,lr_eval_string("<?xml version=\"1.0\" encoding=\"gb2312\"?>")); strcat(params,lr_eval_string("<ICEPrx>")); strcat(params,lr_eval_string("<Case>")); strcat(params,lr_eval_string("<Param name=\"registerInfo\" type =\"Sequence\">")); strcat(params,lr_eval_string("<Param name=\"content\">")); strcat(params,lr_eval_string("<Param name=\"key\" type=\" ::std::string\">longId</Param>")); strcat(params,lr_eval_string("<Param name=\"value\" type=\"::std::string\">{longId}</Param>")); strcat(params,lr_eval_string("</Param>")); strcat(params,lr_eval_string("<Param name=\"content\">")); strcat(params,lr_eval_string("<Param name=\"key\" type=\" ::std::string\">userId</Param>")); strcat(params,lr_eval_string("<Param name=\"value\" type=\"::std::string\"></Param>")); strcat(params,lr_eval_string("</Param>")); strcat(params,lr_eval_string("<Param name=\"content\">")); strcat(params,lr_eval_string("<Param name=\"key\" type=\" ::std::string\">nickname</Param>")); strcat(params,lr_eval_string("<Param name=\"value\" type=\"::std::string\">{nickname}</Param>")); strcat(params,lr_eval_string("</Param>")); strcat(params,lr_eval_string("<Param name=\"content\">")); strcat(params,lr_eval_string("<Param name=\"key\" type=\" ::std::string\">password</Param>")); strcat(params,lr_eval_string("<Param name=\"value\" type=\"::std::string\">111111</Param>")); strcat(params,lr_eval_string("</Param>")); strcat(params,lr_eval_string("<Param name=\"content\">")); strcat(params,lr_eval_string("<Param name=\"key\" type=\" ::std::string\">email</Param>")); strcat(params,lr_eval_string("<Param name=\"value\" type=\"::std::string\">{nickname}@alibaba.com</Param>")); strcat(params,lr_eval_string("</Param>")); strcat(params,lr_eval_string("</Param>")); strcat(params,lr_eval_string("</Case>")); strcat(params,lr_eval_string("</ICEPrx>")); lr_start_transaction("LoadFunc"); rt = LoadFunc(params); lr_output_message("rt = %d",rt); if(rt == -1|| rt == -2){ lr_end_transaction("LoadFunc", LR_FAIL); } lr_end_transaction("LoadFunc", LR_AUTO); return 0; } vuser_end() { return 0; } 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |