www.pudn.com > download.rar > HTTPDownload.h


// HTTPDownload.h: interface for the CHTTPDownload class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_HTTPDOWNLOAD_H__12CAB970_269F_4301_9E5A_2596D4618884__INCLUDED_) 
#define AFX_HTTPDOWNLOAD_H__12CAB970_269F_4301_9E5A_2596D4618884__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
 
const UINT	H_LINK_OK			= 0; 
const UINT	H_LINK_ERROR		= 1; 
 
 
typedef struct HTTPDOWNLOADSTATE{ 
 
	LONG	range[20]; 
	LONG    threadsize[10]; 
	LONG    wcsize[10]; 
}HTTPDOWNLOADSTATE; 
 
 
class CHTTPDownload   
{ 
public: 
 
    CHTTPDownload(); 
	virtual ~CHTTPDownload(); 
	void Begin(CString Allurl, CString Saveas, int nParts); 
	BOOL AnalyseURL(CString Allurl); 
	UINT SendRequest(); 
	BOOL AnalyseReceive(CString ReadBuf, DWORD &dwContentLength, DWORD &dwStatusCode); 
    void CreateThread(); 
	void Finish(); 
    void ThreadFunc(int index); 
	int GetHeadLength(char* lpData); 
	void OnCancel();  
 
public: 
	 
	CString m_strServer; 
    CString m_strObject; 
	CString m_strSavePath; 
	int m_nParts; 
	int m_Port; 
	CSocket m_pSocket; 
	DWORD	m_dwFileSize; 
	DWORD   kk[10]; 
	DWORD   m_sum[10]; 
	BOOL	m_SupportResume; 
	CString   m_strTempSavePath; 
    BOOL     m_bResume; 
	HTTPDOWNLOADSTATE m_state; 
    HANDLE m_hThread[10]; 
	HANDLE m_hNotify; 
	BOOL m_bTerminate[10]; 
	LONG m_index; 
 
	int linkcode; 
	 
     
 }; 
 
#endif // !defined(AFX_HTTPDOWNLOAD_H__12CAB970_269F_4301_9E5A_2596D4618884__INCLUDED_)