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杪,就出错了,有没法
解决方案 »
- TStringList.IndexOf 的问题????
- 用xmlhttp能否向服务器发送url请求?并且不要等待返回?
- 一个关于for循环的问题,急!!
- 求救!!!!!!!
- Delphi 中如何调用别的应用程序?
- 如何不重启使修改的注册表生效?
- 文件操作---太迷茫了,谁帮帮我!!!
- 求助:tquery 中用sql动态查询的问题
- 如何讓dbgrid左邊的行號顯示出來
- 请问,MDI窗口中如何象合并菜单那样合并工具栏?
- 为什么执行 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;