views:

26

answers:

1

I'm automating an Internet Explorer window using the IWebBrowser API. Is there a way to cancel all outstanding HTTP requests in IE/IWebbrowser?

I've tried the following and none of them work.

  1. Calling IWebBrowser::Stop(). This only cancels navigation and does not stop existing downloads from continuing.

  2. Navigating to 'about:blank'. This stops new requests from being made, but existing HTTP requests will continue.

  3. Calling Abort()/Terminate() on each of the IInternetProtocol handlers. This causes IE to crash (not surprisingly).

A: 

using System.Web.SessionState;

Session.Abandon() or
public void Abandon()

Not supported? Not sure which language or tool your using ... but, generally this will abandon the current session.

Joe Garrett
I'm automating an IE browser control client side on the desktop. I think you are talking about an ASP.Net application?
watsonmw
maybe, but I also believe you can instantiate abandon sessions using the browser control as well...or I may just be getting old...lol.
Joe Garrett