procedure TForm1.Timer1Timer(Sender: TObject);
begin
Doc := WebBrowser1.Document as IHTMLDocument2;
EditCookie.Text := Doc.cookie;
end;
我用这个代码格3秒得到WebBrowser1的cookie信息,但有些网站打开慢,超过了3杪,就出错了,有没法
begin
Doc := WebBrowser1.Document as IHTMLDocument2;
EditCookie.Text := Doc.cookie;
end;
我用这个代码格3秒得到WebBrowser1的cookie信息,但有些网站打开慢,超过了3杪,就出错了,有没法
解决方案 »
- cxgrid安装问题
- ReportBuilder在dll中的问题
- 如何在DELPHI 6中判断是否安装了ORCALE 8的客房端?
- 如何获得调用过程的名称
- 这几条语句有什么错误,谢谢
- 安装了flatstyle控件后,在vcl 的palette上看不到刚刚安装的。如何?
- 大富翁真的很奇怪,我有积分,但发不了贴,大家碰到过吗?
- MDI窗口闪烁的问题!
- 请问怎么把Label写成超级连接的样子?
- 打印的问题!怎么没人回答!
- 为什么执行 ShellExecute(0, 'open', PChar('del c:\123.txt'), nil, nil, sw_show)之后,啥反应也没有
- 如何在全局函数中调用from1的成员
begin
Doc := WebBrowser1.Document as IHTMLDocument2;
if Doc <> nil then
EditCookie.Text := Doc.cookie;
end;
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
Doc := WebBrowser1.Document as IHTMLDocument2;
EditCookie.Text := Doc.cookie;
end;
const pDisp: IDispatch; var URL: OleVariant);
begin
Doc := WebBrowser1.Document as IHTMLDocument2;
EditCookie.Text := Doc.cookie;
end;这是最常用正确的办法如果用你的方法可以这样procedure TForm1.Timer1Timer(Sender: TObject);
begin
Doc := WebBrowser1.Document as IHTMLDocument2;
//等待WebBrowser1请求完成
while(Doc=nil)do
begin
Sleep(200);
//这是死循环,当然,你要设置一下循环的次数,比如等待3秒,大约是300次(只能说大约).因为执行循环过程也需要一点点时间
end;
EditCookie.Text := Doc.cookie; end;