Solved

Sending Username and Password Info To Web Site

Posted on 1998-09-14
11
344 Views
Last Modified: 2010-04-30
I am working on an application that visits a web site, parses the html looking for images, and downloads images above a certain size threshold.

The application works fine on any web site that does not require a username and a password.

What I want to do now is provide an interface to the user that allows them to enter the url of the web site they wish to visit, and optionally, the username and password to access the site. The username and password information can appear in several guises.

The most common is to provide a dialog box that requests this information. The next most common method is to display the username and password field on the web page itself. The third most common is the First Virtual (FV) ID which is composed of a single entry field displayed on the web page.

What I most need to know is how to submit the username and password when the web site requests it using the most common of the above methods; that of the dialog box.

I need to do this within my VB app. The urls and their associated usernames and passwords are stored on a table in the database. When the site is visited, the username and password will be retrieved and submited to the web site upon request. This will allow the user to visit a pay website, grab the images, and log off as quickly as possible. They do not have to sit at the keyboard or do anything else save for providing the url, the username, and the password.

Any help in solving this problem would be greatly appreciated.

Regards,
Mike Trivisonno
0
Comment
Question by:mtriviso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +3
11 Comments
 
LVL 14

Expert Comment

by:waty
ID: 1434712
You have to use the SenKeys Method

   SendKeys UserName & "{TAB}"  
   SendKeys Password & "{TAB}"
0
 

Author Comment

by:mtriviso
ID: 1434713
I need to have more information than that.

For example, how do I detect when the web site is requesting this information? I need to know how to detect when the username and password are requested before I can use the SendKeys method.

Also, the iNet Control provides a username and password property. And I assume I would be using this instead of the SendKeys.

If you have done this sort of thing in the past, an example would be greatly appreciated.

Thanks,
Mike
0
 
LVL 14

Expert Comment

by:waty
ID: 1434714
The username and password from Inet are used to connect by FTP. If you browse on FTP site, that's right.

By the way, I don't have any idea on how you could detect when you need to send username and password. I think you should create a collection of URL associated with username and password.
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:mtriviso
ID: 1434715
Ok.

That's what I really need to know: how to detect when the web site is asking for the username and password. In fact, this web site uses the dialog box method. Imagine writing a VB app that would be able to provide the username and password to log you on to Expert Exchange. That's what I need to do.

But, thanks for your input anyway.
0
 
LVL 2

Expert Comment

by:marti
ID: 1434716
1. What happens if you provide UID and PWD in advance?

2. You should be able to detect that dialog box within VB and fill up appropriately.
0
 

Author Comment

by:mtriviso
ID: 1434717
1. The uid and pwd are stored on a table in the database. So they will be known in advance.

2. This is the problem. How do I detect that web site has requested the browser to display a dialog box? How do I detect that event provide the uid and pwd.

I have a method:
Public Sub Inet1_StateChanged(ByVal State As Integer)

It is in this method that I will need to trap the event. What I am looking to trap is the problem. States like GetPage and GetHeader are easy enough. But how to I trap the open dialog request?

Netscape, Opera, and Explorer obviously know how to trap this event. They are always displaying this uid/pwd dialog box. If these apps can do it then I figure I should be able to do it too.
0
 
LVL 1

Expert Comment

by:jf26028
ID: 1434718
0
 

Author Comment

by:mtriviso
ID: 1434719
That's not my problem.

My problem is detecting when the site is requesting this information in the
Public Sub Inet1_StateChanged(ByVal State As Integer)
method.

I need to know when the site is requesting this information before I can supply the uid and pwd.

0
 

Expert Comment

by:mwalsh111097
ID: 1434720
When the HTTP response header indicates a 401 status, the web server is saying that you are not authorized for the request.  It should also include a "WWW-authenticate:" field.  This lets you know when you need to send authentication information.

What else do you need?
0
 
LVL 7

Expert Comment

by:linda101698
ID: 1434721
jf262028,
Please repost your rejected answer as the answer so mtriviso can award you the points.  I received the following message this morning:

jf26028 answered one of my questions correctly but I rejected his
answer.

Is it possible to award him the points?

Here is the url for the question.
http://www.experts-exchange.com/Q.10080555

Thanks,
Mike
0
 
LVL 1

Accepted Solution

by:
jf26028 earned 200 total points
ID: 1434722
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question