VB.NET & EMAIL

I am trying to figure out, for a friend, how to write a VB program that will launch multiple IE's and when those IE's launch fill in the appropriate login name and password for that site. Is there any way that this can be done?
[229 byte] By [QWERTYtech] at [2007-12-25]
# 1
this sounds kinda shady.
wolfr at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

you can launch a process of IE using the System.Diagnostics.Process.Start("http://www.url.com") but as for filling out the form, I'm not sure this can be done but do not quote me.

You can however embed a WebBrowser control in your application, if you have .NET 2.0, and implement the document_completed event then look through the documenttext/page property for tags and modify them but this would be terrible as you would be parsing strings and what not - nasty stuff.

you can SendKeys to the application, IE in this case for example, and enter your details on the form but you would have to know what keys to press (simple) but you need to be specific for each webpage.

ahmedilyas at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
How does this seem shady? My friend has like 5 email addresses and he wants to automate it and be able to carry the .exe on his flash drive and check his mail from any computer with one click.
QWERTYtech at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
couldn't he set up a forwarding option from each one of the sites to forward to a central address?

possibly use an anonymous email forwarding service if he is worried about links between the addys

wolfr at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 5
That is very true. I never thought about that. i will let him know.
QWERTYtech at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 6

Actually, ahmedilyas second method (that of using a WebBrowser control) might not be that bad.

Instead of trying to parse the DocumentText, you can actually use the Document object. You can then get access to all the HTML elements on the page that the browser has already parsed for you. By getting the Forms collection, you can find the form used for login and then find the username and password textboxes.

While this could be different for every site, there are usually some common things to look for such as element name contains "user" and element type is textbox. This will do a pretty good job of finding the controls that you need to autofill. This is basicaly how a browser tool bar's autofill function works.

rkimble at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 7
I'm new to the Document Object aspect of VB. How would I go about setting this up?
QWERTYtech at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 8

After adding a WebBrowser control to the project, you will access the WebBrowser.Document property. The Document.Forms property will expose a list of HTMLElement objects which are all the forms on the page. Then you will look through the Form.Children collection of HTMLElements for the needed textboxes.

That's about as specific as I can get without knowing exactly what pages you're trying to parse. As stated previously, you'll have to experiment a little until you figure out which elements you need and how best to locate them.

rkimble at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...