"Brett" <no@spam.net> schrieb:
How do I perform a web form submission in a windows form and get the
submitted page into a variable? For example, I'd like to create a Win
Form that has a username and pass. Once the Win Form's login button is
clicked, it will log into a web mail account. I will parse the first page
(message list) and display it in another Win Form.
\\\
Imports System.IO
Imports System.Net
..
..
..
Dim wrq As WebRequest = _
WebRequest.Create("https://example.org/shop/order.jsp")
wrq.Credentials = New NetworkCredential("username", "password")
Dim wrp As WebResponse = wrq.GetResponse()
Dim sr As New StreamReader(wrp.GetResponseStream())
MessageBox.Show(sr.ReadToEnd())
sr.Close()
wrp.Close()
///
Replace the URL, "username" and "password" with appropriate values.
For parsing the HTML file:
MSHTML Reference
<URL:http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/reference.asp>
- or -
..NET Html Agility Pack: How to use malformed HTML just like it was
well-formed XML...
<URL:http://blogs.msdn.com/smourier/archive/2003/06/04/8265.aspx>
Download:
<URL:http://www.codefluent.com/smourier/download/htmlagilitypack.zip>
If the file read is in XHTML format, you can use the classes contained in
the 'System.Xml' namespace for reading information from the file.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>