Solved

Getting password protected page with CHttpConnection

Posted on 1997-07-17
5
312 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Need Help INsttalling wget on Mavericks OS X 3 84
Process filename extension 3 157
maxBlock challenge 30 101
changeXy challenge 13 58
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now