Hi,

I'm building a Windows Forms application that parses a variety of web pages.
The web page structure generally includes a search page with form fields and
a "submit" button, and clicking submit loads the results page we're
interested in parsing.

Thanks to some help from here and the MSDN library, I've got the actual
parser working great. I parse the search page for form fields, then create a
WebRequest and write a RequestStream with all the form variables, then I
retrieve a ResponseStream with all the data I need.

Now we've decided it would be nice to give users the option to display the
results page in the web browser, both to confirm the data and because there
are links to other resources on the results page.

I tried just dumping the text into a temp file, but the graphics, styles and
relative links don't come out right. What I would like to do is launch the
web browser and go to the actual results page.

What I need to know is...

1. How do I launch the web browser and go to a specific URI from within a
Windows Forms application?

2. How can I post form data as part of the request?

Thanks,
Adam

USING: VB.NET, Framework 1.1

Re: Launching IE from a Forms App by Cathal

Cathal
Wed Sep 21 20:23:17 CDT 2005

You can just start it as a normal process, and then use the -new
commandswitch to open the site e.g

Imports System.Diagnostics

Dim pIE As New ProcessStartInfo()
With pIE
.FileName = "iexplore"
.Arguments = "-new http://www.mysite.com/"
End With
Process.Start(pIE)

Alternatively, you can embed a browser control in your winforms app. This
article gives examples for both 1.1 and 2.0
http://www.c-sharpcorner.com/Code/2004/Sept/WebBrowserControl.asp

Cathal
"Adam Kenney" <AdamKenney@discussions.microsoft.com> wrote in message
news:E0D12B22-E211-4FAB-AB78-7F2549C1F603@microsoft.com...
> Hi,
>
> I'm building a Windows Forms application that parses a variety of web
pages.
> The web page structure generally includes a search page with form fields
and
> a "submit" button, and clicking submit loads the results page we're
> interested in parsing.
>
> Thanks to some help from here and the MSDN library, I've got the actual
> parser working great. I parse the search page for form fields, then create
a
> WebRequest and write a RequestStream with all the form variables, then I
> retrieve a ResponseStream with all the data I need.
>
> Now we've decided it would be nice to give users the option to display the
> results page in the web browser, both to confirm the data and because
there
> are links to other resources on the results page.
>
> I tried just dumping the text into a temp file, but the graphics, styles
and
> relative links don't come out right. What I would like to do is launch the
> web browser and go to the actual results page.
>
> What I need to know is...
>
> 1. How do I launch the web browser and go to a specific URI from within a
> Windows Forms application?
>
> 2. How can I post form data as part of the request?
>
> Thanks,
> Adam
>
> USING: VB.NET, Framework 1.1
>
>
>



Re: Launching IE from a Forms App by AdamKenney

AdamKenney
Mon Sep 26 19:05:02 CDT 2005

Thanks... I ended up going with the SHDocVw.InternetExplorer object because I
needed to post form data along with my request. After some long searching, I
discovered how the PostData parameter of the Navigate method worked, and now
it's working great.

Thanks for your help.

Adam


"Cathal Connolly [VB MVP]" wrote:

> You can just start it as a normal process, and then use the -new
> commandswitch to open the site e.g
>
> Imports System.Diagnostics
>
> Dim pIE As New ProcessStartInfo()
> With pIE
> .FileName = "iexplore"
> .Arguments = "-new http://www.mysite.com/"
> End With
> Process.Start(pIE)
>
> Alternatively, you can embed a browser control in your winforms app. This
> article gives examples for both 1.1 and 2.0
> http://www.c-sharpcorner.com/Code/2004/Sept/WebBrowserControl.asp
>
> Cathal
> "Adam Kenney" <AdamKenney@discussions.microsoft.com> wrote in message
> news:E0D12B22-E211-4FAB-AB78-7F2549C1F603@microsoft.com...
> > Hi,
> >
> > I'm building a Windows Forms application that parses a variety of web
> pages.
> > The web page structure generally includes a search page with form fields
> and
> > a "submit" button, and clicking submit loads the results page we're
> > interested in parsing.
> >
> > Thanks to some help from here and the MSDN library, I've got the actual
> > parser working great. I parse the search page for form fields, then create
> a
> > WebRequest and write a RequestStream with all the form variables, then I
> > retrieve a ResponseStream with all the data I need.
> >
> > Now we've decided it would be nice to give users the option to display the
> > results page in the web browser, both to confirm the data and because
> there
> > are links to other resources on the results page.
> >
> > I tried just dumping the text into a temp file, but the graphics, styles
> and
> > relative links don't come out right. What I would like to do is launch the
> > web browser and go to the actual results page.
> >
> > What I need to know is...
> >
> > 1. How do I launch the web browser and go to a specific URI from within a
> > Windows Forms application?
> >
> > 2. How can I post form data as part of the request?
> >
> > Thanks,
> > Adam
> >
> > USING: VB.NET, Framework 1.1
> >
> >
> >
>
>
>