Click here to Skip to main content
15,914,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to get name of network adapter card if ip address is given in linux? Pin
David Crow17-Oct-08 2:19
David Crow17-Oct-08 2:19 
Question[Message Deleted] Pin
Le@rner15-Oct-08 23:01
Le@rner15-Oct-08 23:01 
AnswerRe: How can hide a application in Task Manager? Pin
Naveen15-Oct-08 23:27
Naveen15-Oct-08 23:27 
GeneralRe: How can hide a application in Task Manager? Pin
Le@rner15-Oct-08 23:30
Le@rner15-Oct-08 23:30 
GeneralRe: How can hide a application in Task Manager? Pin
Naveen15-Oct-08 23:43
Naveen15-Oct-08 23:43 
AnswerRe: How can hide a application in Task Manager? Pin
Roger Stoltz15-Oct-08 23:51
Roger Stoltz15-Oct-08 23:51 
AnswerRe: [Message Deleted] Pin
Hamid_RT16-Oct-08 4:22
Hamid_RT16-Oct-08 4:22 
Questionaccess password protected site error Pin
George_George15-Oct-08 22:54
George_George15-Oct-08 22:54 
Hello everyone,


Here is my test code. My question is even if I provide a wrong username/password to access passport protected site, like login.live.com, the return code will always be successful.

Anyone have any ideas what is wrong? Smile | :)

#include <string>
#include <iostream>
#include <exception>
#include <windows.h>
#include <wininet.h>
#include <fstream>
#include <conio.h>

using namespace std;

#pragma comment(lib,"wininet.lib")

int main(int argc, char* argv[])
{
       HINTERNET hOpenHandle, hConnectHandle, hResourceHandle;
       DWORD dwError, dwStatus;
       DWORD dwStatusSize = sizeof(dwStatus);

       hOpenHandle = InternetOpen("TestAgent", 
                                                    INTERNET_OPEN_TYPE_PRECONFIG, 
                                                    NULL, NULL, 0);

       hConnectHandle = InternetConnect(hOpenHandle, 
																"login.live.com", 
                                                                80, 
																"GeorgePassport",
																"WrongPassword", 
                                                                INTERNET_SERVICE_HTTP,
                                                                0,0);

       hResourceHandle = HttpOpenRequest(hConnectHandle, "GET",
                                                                 "/",
                                                                 NULL, NULL, NULL, 
                                                                 INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_CACHE_WRITE, 
                                                                 0);

       BOOL fResult = HttpSendRequest(hResourceHandle, NULL, 0, NULL, 0);

       if ( fResult == false )
       {
              cout<<"HttpSendRequest failed!"<<endl;
              cout<<"GetLastError(): "<<::GetLastError()<<endl;
       }

       HttpQueryInfo(hResourceHandle, HTTP_QUERY_FLAG_NUMBER | 
                              HTTP_QUERY_STATUS_CODE, &dwStatus, &dwStatusSize, NULL);

       switch (dwStatus)
       {
              case HTTP_STATUS_PROXY_AUTH_REQ: // Proxy Authentication Required
              case HTTP_STATUS_DENIED:     // Server Authentication Required.
                     cout<< "auth failed!"<<endl;
                     break;
              case HTTP_STATUS_OK:
                     cout<< "auth pass!"<<endl;
                     break;
              default:
                     cout<< "what happens here?"<<endl;
                     break;
       }

       return 0;
}



thanks in advance,
George
AnswerRe: access password protected site error Pin
KarstenK16-Oct-08 0:03
mveKarstenK16-Oct-08 0:03 
GeneralRe: access password protected site error Pin
George_George16-Oct-08 0:18
George_George16-Oct-08 0:18 
Questiondirectsound Pin
viliam15-Oct-08 22:09
viliam15-Oct-08 22:09 
AnswerRe: directsound Pin
CPallini15-Oct-08 22:22
mveCPallini15-Oct-08 22:22 
AnswerRe: directsound Pin
_AnsHUMAN_ 15-Oct-08 22:37
_AnsHUMAN_ 15-Oct-08 22:37 
GeneralRe: directsound Pin
viliam15-Oct-08 22:46
viliam15-Oct-08 22:46 
AnswerRe: directsound Pin
Hamid_RT16-Oct-08 4:28
Hamid_RT16-Oct-08 4:28 
QuestionFraming a window - Not at creation [modified] Pin
urbanyoung15-Oct-08 21:57
urbanyoung15-Oct-08 21:57 
AnswerRe: Framing a window - Not at creation Pin
Jose David Pujo16-Oct-08 2:03
Jose David Pujo16-Oct-08 2:03 
QuestionCopying the Data from an ASCII Text File on a PC Back to an Operating System Spooled File for Iseries Pin
aa_zz15-Oct-08 21:28
aa_zz15-Oct-08 21:28 
AnswerRe: Copying the Data from an ASCII Text File on a PC Back to an Operating System Spooled File for Iseries Pin
SandipG 15-Oct-08 21:57
SandipG 15-Oct-08 21:57 
GeneralRe: Copying the Data from an ASCII Text File on a PC Back to an Operating System Spooled File for Iseries Pin
Hamid_RT16-Oct-08 4:26
Hamid_RT16-Oct-08 4:26 
QuestionCopying the Data from an ASCII Text File on a PC Back to an Operating System Spooled File for Iseries don't use ftp(visual C++6.0) Pin
aa_zz15-Oct-08 21:15
aa_zz15-Oct-08 21:15 
QuestionMonitoring network traffic on LAN using VC++ Pin
tony_Udz15-Oct-08 20:45
tony_Udz15-Oct-08 20:45 
AnswerRe: Monitoring network traffic on LAN using VC++ Pin
SandipG 15-Oct-08 21:03
SandipG 15-Oct-08 21:03 
GeneralRe: Monitoring network traffic on LAN using VC++ Pin
tony_Udz16-Oct-08 1:41
tony_Udz16-Oct-08 1:41 
AnswerRe: Monitoring network traffic on LAN using VC++ Pin
Mark Salsbery16-Oct-08 4:33
Mark Salsbery16-Oct-08 4:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.