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...
解决方案 »
- delphi 数据集中字段的显示值和存储值
- 求一个用lookup字段和dbgrid的例子。
- Delphi报表另存为.xls或.rtf格式时连线和图片都不可见,为什么?
- 与日期相关的数据库检索
- 请教一个问题:如何用SQL语句备分、恢复ACCESS数据库啊???
- 请帮忙把下面vba代码转换成delphi程序(用olecontainer),谢谢!分还可以加!
- 请各位朋友说说对uml的理解
- 我想编个像金洪恩的教学软件该怎么编?
- 怎么通过编程实现WIN98中的WINPOPUP的发送和接收消息的功能?
- 我在msdn中看到这样的一段话,是关于在多线程中使用com的一些建议,想听听大家的经验和看法...
- 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