Solved

Getting password protected page with CHttpConnection

Posted on 1997-07-17
5
319 Views
Last Modified: 2013-11-20
Hi, I have been experimenting with a program to download webpages, based on the MFC 'Tear' sample app. How do I get this program to submit a username and password for a protected page. (It uses CHttpConnection and CHttpFile to retrieve the web-page)
0
Comment
Question by:johand
[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
5 Comments
 
LVL 4

Expert Comment

by:mbhakta
ID: 1302635
Are you talking about the login dialog box which pop's up when you try connecting to your Nprovider ?
0
 

Author Comment

by:johand
ID: 1302636
No, I would like to retrieve a page that requires a CGI (I think) posted username and password before you can download the page. When I do a HTTP_VERB_GET, the return value of QueryInfoStatusCode is HTTP_STATUS_DENIED, and the 'Tear' sample then mentions sending a username/password to retrieve this page.

But how do you do that ?

(Sorry of this is a bit vague, I'm still a bit new to internet programming ;) )
0
 
LVL 3

Expert Comment

by:jaba
ID: 1302637
Username and password implemented not by CGI script. When you opening HTTP file it look like you opening ordinar file on remote computer.  Password and username required tfor the SERVER security system ( usially it file system ). So , not worry about it :-(

0
 

Author Comment

by:johand
ID: 1302638
This MUST be possible programmatically, because offline browsers  (such as GotIt etc) ask you to specify a username/password for a webpage (if it requires one) to download the page in the background.
0
 
LVL 3

Accepted Solution

by:
vinniew earned 200 total points
ID: 1302639
That information is passed on a different port.  Try using port 443.  Usually web servers use 1080 for http stuff.

I suppose you'd have to listen to port 443 for activity, and then respond.  Check out the RFC for *exacting* details.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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