请问在activeform控件中怎么访问本地的cookie?

解决方案 »

  1.   

    在AcitvexForm中得到当前IE对象,然后就可以读取Cookie值了;var
      browser: IWebBrowser2;
      isp: IServiceProvider;
      doc:IHTMLDocument2;
    begin
      isp := ActiveFormControl.ClientSite as IServiceProvider;
      if (isp.QueryService(IWebbrowserApp, IWebbrowser2, browser) = S_OK) then
       begin
         doc:= browser.Document as IHTMLDocument2;
         showmessage(doc.cookie);
       end;
    end;
      

  2.   

    试了一下,不行啊,doc:IHTMLDocument2;缺少头文件,我目前想要实现的就是取得另外一个aspx页面的叫lk的cookie的值。试了半天都不行啊。