Solved

Using CInternetSession with a proxy server

Posted on 1997-05-26
1
867 Views
Last Modified: 2013-11-19
At my company we have to go through a proxy server that reqiur a username and password. My problem is that I cant go through to the internet with the code at the bottom. If I ftp local and I disable the proxy setting in the registry it work fine. And I made double sure my passwords are correct.Can you please help me or give me some code that make use of the proxy settings.Here are some of my code
DWORD UsernameLen = 20, PassLen = 20;
BOOL temp2;

m_pInetSession = new CInternetSession( NULL, 1, INTERNET_OPEN_TYPE_PROXY,  "firewall.sasol.com:80", NULL, 0 );
m_pInetSession = new CInternetSession( );
if (m_pInetSession->SetOption( INTERNET_OPTION_USERNAME, (LPVOID) Username, UsernameLen ) == FALSE) return;
if (m_pInetSession->SetOption( INTERNET_OPTION_PASSWORD, (LPVOID) Password, PassLen ) == FALSE) return;//QueryOption

m_pFtpConnection = m_pInetSession->GetFtpConnection( "155.237.42.26","utilftp","sasol" );
0
Comment
Question by:401980
1 Comment
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1301823
Are you using a CERN proxy? WININET, the system DLL that actually implements the CFtpConnection object for MFC, turns out to not support FTP connections through CERN proxies.

You _can_ get the connection to work through the proxy, though; you'll have to use the INTERNET_FLAG_RAW_DATA flag in the dwFlags parameter.  The technique you'll need to use is documented in the Microsoft KnowledgeBase.  Please see the article at http://www.microsoft.com/kb/articles/q166/9/61.htm

.B ekiM

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 54
move a line in eclipse 3 107
Smart Camera scanning and reading information 3 113
java ^ examples 8 69
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. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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