No equivalent class in VC. but you can do it in this way:
construct an CInternetSession object, and then call CInternetSession::GetHttpConnection to get an CHttpConnection object, then call CHttpConnection::OpenRequest to open the URL.

解决方案 »

  1.   

    啊,能说的详细点吗?我试过OpenRequest,可不知最后那个我需要的参数该往哪放啊!!!!!
      

  2.   

    CInternetSession session("My Session");
        CHttpConnection* pServer = NULL;
        CHttpFile* pFile = NULL;
        CString ServerName = "webmail.21cn.com";
        INTERNET_PORT nPort = 80;
        DWORD retcode;
        char outBuff[300] = "LoginName=aaa&passwd=xxx&DomainName=21cn.com";//I have test this with my loginname and password
        try
        {
            pServer = session.GetHttpConnection(ServerName,nPort);
            pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST,"/NULL/NULL/NULL/NULL/NULL/SignIn.gen",NULL,1,NULL,NULL,INTERNET_FLAG_EXISTING_CONNECT);
            pFile -> AddRequestHeaders("Content-Type: application/x-www-form-urlencoded");
            pFile -> AddRequestHeaders("Accept: */*");
            pFile -> SendRequest(NULL,0,outBuff,strlen(outBuff)+1);
            pFile -> QueryInfoStatusCode(retcode);
            // you can read from the file after this......I've just left it out.
            for(int i=0;i<10;i++)//read ten line of returned HTML,you need to edit this to use the result
            {
            CString smsg;
            pFile->ReadString(smsg);
            AfxMessageBox(smsg);
            }
    DWORD dwlen=pFile->GetLength();
    char buf[1024];
    DWORD dwread=pFile->Read(buf,1024);
        }
        catch (CInternetException * e){};
        delete pFile;
        delete pServer;
        session.Close();