Solved

Using CInternetSession with a proxy server

Posted on 1997-05-26
1
897 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
[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
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

[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: 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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

615 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