473,385 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to log into webmail?

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.

Thanks,
Brett
Nov 21 '05 #1
2 1640
"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/>

Nov 21 '05 #2

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
"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/>

I tried your code but only get the login page. It doesn't return the page
after login, which means it isn't logging in. I was trying the following
code but getting the same results:

Dim myclient As System.Net.WebClient = New System.Net.WebClient
myclient.Headers.Add("Content-Type", "text/html;
charset=ISO-8859-1")

Dim d As Byte() =
System.Text.Encoding.ASCII.GetBytes("us*********** ****@verizon.net&password=somepass&jsCapable=1&fra mes=0&LOCALE=en_US&VARIANT=")
Dim res As Byte() =
myclient.UploadData("http://netmail.verizon.net/en_US/agent/moblogin",
"POST", d)

Me.rtxtShowWebpage.Text = System.Text.Encoding.ASCII.GetString(res)

You can see above I'm submitting all the login page form variables. Is this
a cookie issue? How is that handled?

Thanks,
Brett
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James Butler | last post by:
Setup: Red Hat Linux 8.0 Apache 1.3.27 PHP 4.3.2 Sendmail 8.11.6 Other Info: root:root /var/spool/mail root:root /var/spool/mqueue Apache running as nobody:nobody
0
by: Mike | last post by:
I'm about to start work on a custom webmail system for a client. I built a similar system a few years ago by hacking apart SquirrelMail (http://www.squirrelmail.org/), which was the best option at...
3
by: Bengt Richter | last post by:
I guess there's python at the bottom of php? Anyway, is someone here familiar with the message that looks like """ Please purge your trash folder regularly. You can do this by clicking on the...
6
by: David Aldred | last post by:
Is there any 'plug n play' code out there to create a webmail site? I have a domain which supports pop email and i allow people their own email address from me, and some have asked if I can create...
0
by: Christopher Brandsdal | last post by:
I have a http://www.webmailasp.net/ webmail set up on my server. I have just set up a new mailserver for my domains. This is a UNIX that uses pop3s. Has anyone tried to use this or any other...
0
by: joe | last post by:
I am writting a webmail client using mysql as the backend. I wrote the scripts using a table for each separate user. I am thinkig about putting all users in one table. the table structure now is...
2
by: anna | last post by:
Firefox Mozilla Browser Fonts / Format / rich text / webmail question I have Comcast. They do not support Firefox so they won't help me. When I use Mozilla firefox browser to access my web...
9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
1
by: Jason | last post by:
I am trying to send mail via SMTP, using VB.NET on XP. I keep getting this error: "Could not access 'CDO.Message' object." (I can send mail fine via VB6, using CDONTS.) I have added a reference...
0
by: sangam56 | last post by:
Hi all, I have come accross the requirement that I need to integrate one webmail system in an existing asp.net web application. I searched a lot in the Internet. I basically got two products: one...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.