資源簡介
用MFC實現的簡單的HTTP的POST和GET方法,方便調用
代碼片段和文件信息
#include?“StdAfx.h“
#include?“HttpClient.h“
//#include?“yazuoLog.h“
#define??BUFFER_SIZE???????1024
#define??NORMAL_CONNECT?????????????INTERNET_FLAG_KEEP_CONNECTION
#define??SECURE_CONNECT????????????????NORMAL_CONNECT?|?INTERNET_FLAG_SECURE
#define??NORMAL_REQUEST?????????????INTERNET_FLAG_RELOAD?|?INTERNET_FLAG_DONT_CACHE?
#define??SECURE_REQUEST?????????????NORMAL_REQUEST?|?INTERNET_FLAG_SECURE?|?INTERNET_FLAG_IGNORE_CERT_CN_INVALID
CHttpClient::CHttpClient(LPCTSTR?strAgent)
{
m_pSession?=?new?CInternetSession(strAgent);
m_pConnection?=?NULL;
m_pFile?=?NULL;
}
CHttpClient::~CHttpClient(void)
{
Clear();
if(NULL?!=?m_pSession)
{
m_pSession->Close();
delete?m_pSession;
m_pSession?=?NULL;
}
}
void?CHttpClient::Clear()
{
if(NULL?!=?m_pFile)
{
m_pFile->Close();
delete?m_pFile;
m_pFile?=?NULL;
}
if(NULL?!=?m_pConnection)
{
m_pConnection->Close();
delete?m_pConnection;
m_pConnection?=?NULL;
}
}
int?CHtt
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????859??2013-04-27?15:58??HttpClient.h
?????文件????????3690??2013-05-29?14:52??HttpClient.cpp
評論
共有 條評論