BCB中如何使用cookie(加分,大家帮忙啊)
在《BCB中如何使用cookie》或者《BCB中如何使用cookie(加分,大家帮忙啊)》中回复答案均可,请在另一个贴中也回复(顶一下就好),方便加分,谢谢!
按照网上搜索的代码进行改编,写了下面一段,不过BCB报错说Response,request没有定义,如何解决呢,另外如果用webbrowser如何处理呢,谢谢!!
TStringList* Cookies = new TStringList();
Cookies- >Add("TUserID=10039"); // whatever...
Cookies- >Add("TUserPSW=830131");
Cookies- >Add("TServerAdd=166.111.80.56");
Cookies- >Add("TRID=3");
Cookies- >Add("TRPSW=NULL");
//TWebRequest *Request;
//TWebResponse *Response;
Response- >SetCookieField(Cookies,NULL,NULL,Now()+1,false);
DWORD TUserID;
int TRID;
char TUserPSW[30],TServerAdd[30],TRPSW[30];
// in = fopen("InputFile.txt","r");
// fscanf(in,"%D%s%s",TUserID,TUserPSW,TServerAdd);
TUserID = StrToInt(request- >CookieFields- >Values["TUserID"]);
TUserPSW = request- >CookieFields- >Values["TUserPSW"];
TServerAdd = request- >CookieFields- >Values["TServerAdd"];
TRID = request- >CookieFields- >Values["TRID"];
TRPSW = request- >CookieFields- >Values["TRPSW"];
[解决办法]
你就是没有定义吧,定义被你注掉了
//TWebRequest *Request;
//TWebResponse *Response;
[解决办法]
#include "httpapp.hpp"
[解决办法]