Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic proxy authentication

Status
Not open for further replies.

dg043

Programmer
Apr 22, 2002
52
0
0
GB
Hi,

I am trying to write a program that will open a web page in Internet Explorer and save the result. I am having a problem with my proxy server though. If I wasn't using a proxy, the code would be:
Code:
Dim wbBrowser as New SHDocVw.InternetExplorer

wbBrowser.Visible = True
wbBrowser.Navigate "[URL unfurl="true"]http://www.google.com"[/URL]
However, I can find no information anywhere on how to supply a username and password value to the InternetExplorer object when a proxy is used. Can anyone help?

Dan Griffiths
Software Analyst
National Grid plc
 
Where do you enter your password? I use a proxy and this code worked for me (after adding a reference to mshtml):
Code:
Dim _doc As New mshtml.HTMLDocument
_doc.url = "[URL unfurl="true"]http://www.google.com"[/URL]

Visit my web site at
 
If you open Internet Explorer and type into the address bar and pres enter, a message box appears asking for my proxy username and password. I would like to be able to specify this username and password programmatically.
I suspect that if you do not receive this, then it is because either your proxy doesn't require a username and password or it is the same as the Windows username and password you are currently logged in with

Dan Griffiths
Software Analyst
National Grid plc
 
Perhaps you could use the SendKeys class to type in the user name and password? In the code below, the program types in the user name (Dan), tabs to the next field, and then types the password (Password).

Code:
Dim _doc As New mshtml.HTMLDocument
_doc.url = "[URL unfurl="true"]http://www.google.com"[/URL]
AppActivate("[URL unfurl="true"]http://www.google.com")[/URL]
System.Windows.Forms.SendKeys.SendWait("Dan")
System.Windows.Forms.SendKeys.SendWait("{tab}")
System.Windows.Forms.SendKeys.SendWait("Password")

Visit my web site at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top