Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using CInternetSession with a proxy server

Posted on 1997-05-26
1
Medium Priority
?
945 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 150 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

926 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