Accessing FORM POST data via the .NET 2 WebBrowser control

  • Thread starter Thread starter dbounds
  • Start date Start date
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
 
...Anyone?

Does anything exist like the BeforeNavigate2 event? Based on MSDN, it
appears it offered up all FORM POST information.
 
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
 
Back
Top