Accessing FORM POST data via the .NET 2 WebBrowser control

D

dbounds

Hello,

I'm trying to access FORM POST data when a user submits a form through
the WebBrowser control of a WinForm app. I need to be able to record
all the user actions as part of a script to be used later. Currently
all i seem to be able to access is GET request data as part of the URI.

Any assistance would be greatly appreciated.

Darren
 
D

dbounds

...Anyone?

Does anything exist like the BeforeNavigate2 event? Based on MSDN, it
appears it offered up all FORM POST information.
 
T

timpub

The .Net 2 WebBrowser control lets you access the ActiveX control it's
based on via:

wb.ActiveXInstance.

Thus if you add a reference to SHDocVw to your project you can access
the BeforeNavigate2 event like so:

((SHDocVw.WebBrowser)wb.ActiveXInstance).BeforeNavigate2 += new
SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(ActivityCatalogue_BeforeNavigate2);

I haven't tested a form post on this but it seems to behave just as the
old BeforeNavigate2 does.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top