begin PostDataStream := TStringStream.Create('');
postList := TStringList.Create;
postList.Add('&loginsubmit=1');
postList.Add('&cookietime=315360000');
postList.Add('&formhash=4cd69240');
postList.Add('&username=' + Edit1.Text + '&password=' + Edit2.Text);
URL := 'http://192.168.1.151:82/do.php?ac=5e88d16502799f5a6ea64cdc58a84dc7&&ref';
try
IdHTTP1.HandleRedirects := true;
IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP1.Request.Referer := URL;
IdHTTP1.Request.AcceptLanguage := 'zh-cn';
IdHTTP1.Request.Connection := 'Keep-Alive';
IdHTTP1.Post(URL, postList, PostDataStream);
except
IdHTTP1.Disconnect;
end;
showmessage(IdHTTP1.Response.RawHeaders.Text);
end;
这个就是我的登陆代码,目前登陆成功,我想实现类似ShellExecute那样调用浏览器打开登陆成功后的主页。
有人知道怎么做吗?PostDataStream.datastring.返回的是脚本windows.location...
postList := TStringList.Create;
postList.Add('&loginsubmit=1');
postList.Add('&cookietime=315360000');
postList.Add('&formhash=4cd69240');
postList.Add('&username=' + Edit1.Text + '&password=' + Edit2.Text);
URL := 'http://192.168.1.151:82/do.php?ac=5e88d16502799f5a6ea64cdc58a84dc7&&ref';
try
IdHTTP1.HandleRedirects := true;
IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP1.Request.Referer := URL;
IdHTTP1.Request.AcceptLanguage := 'zh-cn';
IdHTTP1.Request.Connection := 'Keep-Alive';
IdHTTP1.Post(URL, postList, PostDataStream);
except
IdHTTP1.Disconnect;
end;
showmessage(IdHTTP1.Response.RawHeaders.Text);
end;
这个就是我的登陆代码,目前登陆成功,我想实现类似ShellExecute那样调用浏览器打开登陆成功后的主页。
有人知道怎么做吗?PostDataStream.datastring.返回的是脚本windows.location...
解决方案 »
- 如何判断一个文件是否被使用?
- 关于操作系统的问题,导致无法正常连接ASTA服务器端程序.
- 请问怎样把TABLE控件中的图片字段写入EXECL文件,?
- $$$那位老大用过QuickReport做过套打可以再Epson LQ-1600K下打印,帮帮忙,谢谢!!!!
- 使用ListView显示图片的效果问题!
- Delphi操作Word文档的问题
- 从今天开始,不要老在CSDN里乱晃,但不是不来。
- delphi Edit组件
- 请问如何进行近似查询????
- 少林菜鸟:有没有针对学习delphi的pascal书籍下载,谢谢,34加上了!
- fastreport sum()函数问题.
- cxgrid的CheckBox 不显示勾选问题
用TWebBrowser这个的确可以正常登陆并显示网站主页,但是我的目的是类用QQ登陆QQ邮件那种,单击那个按钮就可以用默认浏览器打开该用户的的邮箱页面。我都找快一个月了,没有办法,不会啊。
这样安全性没问题,也没那么复杂。
1.login.asp
2.login.htm
2.show.asp如果用户直接访问show.asp,比较简单的做法是,
show.asp里面查cookie中的用户名及密码等信息是否正确,如果正确,显示相应内容
如果不正确或没cookie,重定向到login.htm
login.htm表单,让用户输入用户名及密码等信息,post给login.asp
login.asp提取表单数据,验证用户名及密码,如果正确,创建或修改cookie记录用户名及密码,重新跳转到show.asp