delphi 网页源代码
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了delphi 网页源代码相关的知识,希望对你有一定的参考价值。
如何用delphi获取网页的源代码 而且能获取重定向后的网页
比如获取一个论坛的源代码 然后能输入用户名密码登录
还能返回登录后的网页
说明:不要用 delphi 的 webbrowser 控件
用其他的怎么做呀
然后把idhttp的HandleRedirects设置为true
一般登陆过程是POST的 所以需要用idhttp post来写具体代码在下面
procedure TForm1.Button1Click(Sender: TObject);
var
sParams:TStringStream;
begin
sParams:=TStringStream.Create('问号后面的参数 也就是提交的登陆参数');
sParams.WriteString();
IdHTTP1.Request.ContentType:='application/x-www-form-urlencoded';
Memo1.Text:=Idhttp1.Post('提交网页要加http://',sParams);
end; 参考技术B uses idhttp;
function getPage(URL:String):string;
var
http:tidhttp;
begin
result:='';
http:=tidhttp.Create(nil);
try
result:=http.Get(url);
except
// 错误304(转向)
if http.ResponseCode=304 then
result:='location='+http.Response.Location;
end;
http.Free;
end;本回答被提问者采纳 参考技术C 以下就是的,你可以试试,应该可以的:
uses idhttp;
function getPage(URL:String):string;
var
http:tidhttp;
begin
result:='';
http:=tidhttp.Create(nil);
try
result:=http.Get(url);
except
// 错误304(转向)
if http.ResponseCode=304 then
result:='location='+http.Response.Location;
end;
http.Free;
end; 参考技术D 为什么不用webbrowser?
这个控件有漏洞吗?
Delphi 窗体中怎样嵌入网页
我想在窗体上显示网站内容,能做到吗?要是能读取指定文本框中的内容或向指定的文本框中写入内容就更好了,谢谢各位大侠。
参考技术A 双击不行,只能在属性面板里找到相应的事情,在事情里写代码2011-10-24 5:41:44 参考技术B 双击不行,只能在属性面板里找到相应的事件,在事件里写代码 参考技术C 有网页控件可用以上是关于delphi 网页源代码的主要内容,如果未能解决你的问题,请参考以下文章
求delphi中,程序界面嵌入网页的办法,网上有很多办法,试了不行。