控制IE自动登录网站的代码
谁能给个控制IE自动登录www.brokerforum.com的代码,重谢!
[解决办法]
你的www.brokerforum.com我无法打开,所以无法测试,自动登录网站,我一般用Indy控件,但首先要看网站提交的方式(get/put)及变量(参数),如:
TStringList *s=new TStringList(); //参数
TStream *m=new TMemoryStream(); //返回结果
s->Add("User=hahahaha&Password=hohohohoho"); //要提交的变量名,用&隔开
//////
http->Request->Accept="image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*";
http->Request->ContentType ="application/x-www-form-urlencoded";
http->Request->ContentType ="text/css";
http->Request->Connection="keep-alive";
http->Request->ContentLanguage="zh-cn";
http->Request->ContentEncoding="gzip, deflate";
http->Request->UserAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon; .NET CLR 1.1.4322)";
////以上参数,不一定要,要测试
//http->Request->Referer=参照页
http->Host="http://www.brokerforum.com"; //主页
http->Post("http://www.brokerforum.com/login.aspx",s,m); //登录页面,POST方式
...
m就是返回的网页