?? request.h
字號:
// Request.h: interface for the Request class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_REQUEST_H__F90A9FAB_6BC7_4190_97A1_30E113A4AFCD__INCLUDED_)
#define AFX_REQUEST_H__F90A9FAB_6BC7_4190_97A1_30E113A4AFCD__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winsock2.h>
#include "HttpLookDlg.h" // Added by ClassView
#pragma comment(lib,"wsock32")
#define MEM_BUFFER_SIZE 10
/*
HTTPRequest: Structure that returns the HTTP headers and message
from the request
*/
typedef struct
{
LPSTR headerSend; // Pointer to HTTP header Send
LPSTR headerReceive; // Pointer to HTTP headers Receive
LPSTR message; // Pointer to the HTTP message
long messageLength; // Length of the message
} HTTPRequest;
/*
MemBuffer: Structure used to implement a memory buffer, which is a
buffer of memory that will grow to hold variable sized
parts of the HTTP message.
*/
typedef struct
{
unsigned char *buffer;
unsigned char *position;
size_t size;
} MemBuffer;
class Request
{
public:
Request();
virtual ~Request();
private:
void MenBufferCreate(MemBuffer &m);
void MenBufferGrow(MemBuffer &m);
void MenBufferAddbyte(MemBuffer &m,BYTE byte);
void MenBufferAdd(MemBuffer &m,unsigned char * buffer,size_t size);
// BOOL ValidURL(CString &strURL);
int SendHttp(LPCSTR url,HWND hwnd,LPCSTR headerReceive,BYTE *post,
DWORD postLength,HTTPRequest *req);
DWORD GetHostAddress(LPCSTR host);
void SendString(SOCKET sock,LPCSTR str);
void ParseURL(LPCSTR url,CString &protocol,CString &host,CString &request,int &port);
public:
void SendRequest(LPCSTR url,HWND hwnd,int nIsPost,CString &strHeaderPost,CString &strHeaderSend,
CString &strHeaderRecive,CString &strMessage);
protected:
CHttpLookDlg httpLook;
};
#endif // !defined(AFX_REQUEST_H__F90A9FAB_6BC7_4190_97A1_30E113A4AFCD__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -