|
本帖最后由 hbacc2047003 于 2013-9-9 16:02 编辑
- char *randstring(int slen)
- {
- int i,randid;
- char temp[100]="";
- char character_set[52]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','a','b','c',
- 'd','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t'};
- for(i=1;i<=slen;i++)
- {
- randid = rand()%52;
- sprintf(temp,"%s%c",temp,character_set[randid]);
- }
- return(temp);
- }
- Action()
- {
- web_url("phpwind85",
- "URL=http://127.0.0.1:8080/phpwind85",
- "TargetFrame=",
- "Resource=0",
- "RecContentType=text/html",
- "Referer=",
- "Snapshot=t3.inf",
- "Mode=HTML",
- EXTRARES,
- "Url=/phpwind85/js/lang/zh_cn.js", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/topbar.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/bg.jpg", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/button.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/navA.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/hB.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/searchA.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/down.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/colon.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/select_arrow.gif", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/h.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/new.gif", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/del.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/search_btn.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind8gray/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind8black/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind8green/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind8purple/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/wind85/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/phpwind85/images/register/regright.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- "Url=/favicon.ico", "Referer=", ENDITEM,
- "Url=/phpwind85/images/pwicon/top.png", "Referer=http://127.0.0.1:8080/phpwind85/", ENDITEM,
- LAST);
- lr_think_time(25);
- web_submit_data("login.php",
- "Action=http://127.0.0.1:8080/phpwind85/login.php",
- "Method=POST",
- "TargetFrame=",
- "RecContentType=text/html",
- "Referer=http://127.0.0.1:8080/phpwind85/",
- "Snapshot=t4.inf",
- "Mode=HTML",
- ITEMDATA,
- "Name=jumpurl", "Value=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Name=step", "Value=2", ENDITEM,
- "Name=pwuser", "Value={usernameid}", ENDITEM,
- "Name=pwpwd", "Value=1234567", ENDITEM,
- "Name=head_login", "Value=", ENDITEM,
- "Name=lgt", "Value=0", ENDITEM,
- EXTRARES,
- "Url=images/register/regright2.png", ENDITEM,
- "Url=js/lang/zh_cn.js", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/bg.jpg", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/topbar.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/g/facebg_a.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/down.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/navA.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/searchA.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/search_btn.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/down.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/colon.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/hB.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/h.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/new.gif", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind8gray/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind8black/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind8green/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind8purple/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/wind85/preview.jpg", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/register/regright.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- "Url=images/pwicon/top.png", "Referer=http://127.0.0.1:8080/phpwind85/index.php", ENDITEM,
- LAST);
- lr_save_string(randstring(5),"searchstring");
- //lr_output_message("zheshi %s",temp[100]);
- lr_think_time(10);
- lr_start_transaction("search");
- web_submit_data("searcher.php",
- "Action=http://127.0.0.1:8080/phpwind85/searcher.php",
- "Method=POST",
- "TargetFrame=",
- "RecContentType=text/html",
- "Referer=http://127.0.0.1:8080/phpwind85/index.php",
- "Snapshot=t5.inf",
- "Mode=HTML",
- ITEMDATA,
- "Name=verify", "Value=b2496deb", ENDITEM,
- "Name=step", "Value=2", ENDITEM,
- "Name=type", "Value=thread", ENDITEM,
- "Name=keyword", "Value={searchstring}", ENDITEM,
- EXTRARES,
- "Url=images/search/search_del.png", ENDITEM,
- "Url=images/search/search_btn.png", ENDITEM,
- "Url=images/search/pImg.png", ENDITEM,
- "Url=u/images/pre.cur", ENDITEM,
- "Url=u/images/next.cur", ENDITEM,
- "Url=images/search/pImg_close.png", ENDITEM,
- LAST);
- lr_end_transaction("search", LR_AUTO);
- return 0;
- }
复制代码 有这么几个问题,希望达人解答下
1.如果上述代码所述,函数randstring写在action外面是能完全走完脚本的,但是为什么写在action里面就各种报错了呢?错误信息不截图了,太多了
2.如102行代码所示,我想输出一个值,查看随机出的字符串。但是只要加上这行代码,会提示我以下信息
Action.c (14): warning: pointer to local `temp' is an illegal return value
Action.c (102): undeclared identifier `temp'
Action.c (102): type error: pointer expected
e:\\phpwind\301\252\317\265\275\305\261\276\\\277\264\314\373\\\\combined_\277\264\314\373.c (5): 2 errors, not writing pre_cci.ci |
|