KaramChand03
February 12th, 2005, 09:12 AM
Hello,
I want to access a .htaccess protected file at:
http://www.webyog.com/tempaccess/SQLyogTunnel.php
Username and password for the above site is:
Username: ritesh
password: ritesh
To connect I am doing the following sequence:
m_InternetSession = InternetOpen ( "MyApp", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 );
if ( !m_InternetSession )
return false;
m_InternetConnect = InternetConnect ( m_InternetSession, m_HostName, m_Port, m_UserName, m_Password, INTERNET_SERVICE_HTTP, 0L, 0L );
if ( !m_InternetConnect )
return false;
m_HttpOpenRequest = HttpOpenRequest( m_InternetConnect, "POST", m_FileName, NULL, NULL, NULL, flags, 0L );
if ( !m_HttpOpenRequest )
return false;
In InternetConnect, the m_UserName and m_Password are correctly given to be "ritesh" and "ritesh".
After this I correctlypost my data using HttpSendRequestEx() and InternetWritefile(). Then I need to initiate the end by using HttpEndRequest()... the function returns FALSE.
When doing HttpQueryInfo().. I get a status code of HTTP_STATUS_DENIED. I call:
InternetErrorDlg ( GetDesktopWindow(), m_HttpOpenRequest, ERROR_INTERNET_INCORRECT_PASSWORD,
FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_GENERATE_DATA | FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS,
NULL);
But it always returns ERROR_INTERNET_FORCE_RETRY.
Furthermore, even if I use URL like:
http://ritesh:ritesh@www.webyog.com/tempaccess/SQLyogTunnel.php
I am never able to login. But the above link correctly works with IE and FireFox.
I am sure I am doing something wrong? Can somebody help?
Any sample code will be best :)
Regards,
Karam
I want to access a .htaccess protected file at:
http://www.webyog.com/tempaccess/SQLyogTunnel.php
Username and password for the above site is:
Username: ritesh
password: ritesh
To connect I am doing the following sequence:
m_InternetSession = InternetOpen ( "MyApp", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 );
if ( !m_InternetSession )
return false;
m_InternetConnect = InternetConnect ( m_InternetSession, m_HostName, m_Port, m_UserName, m_Password, INTERNET_SERVICE_HTTP, 0L, 0L );
if ( !m_InternetConnect )
return false;
m_HttpOpenRequest = HttpOpenRequest( m_InternetConnect, "POST", m_FileName, NULL, NULL, NULL, flags, 0L );
if ( !m_HttpOpenRequest )
return false;
In InternetConnect, the m_UserName and m_Password are correctly given to be "ritesh" and "ritesh".
After this I correctlypost my data using HttpSendRequestEx() and InternetWritefile(). Then I need to initiate the end by using HttpEndRequest()... the function returns FALSE.
When doing HttpQueryInfo().. I get a status code of HTTP_STATUS_DENIED. I call:
InternetErrorDlg ( GetDesktopWindow(), m_HttpOpenRequest, ERROR_INTERNET_INCORRECT_PASSWORD,
FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_GENERATE_DATA | FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS,
NULL);
But it always returns ERROR_INTERNET_FORCE_RETRY.
Furthermore, even if I use URL like:
http://ritesh:ritesh@www.webyog.com/tempaccess/SQLyogTunnel.php
I am never able to login. But the above link correctly works with IE and FireFox.
I am sure I am doing something wrong? Can somebody help?
Any sample code will be best :)
Regards,
Karam