www.pudn.com > download.rar > HTTPSDownload.h
// HTTPSDownload.h: interface for the CHTTPSDownload class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_HTTPSDOWNLOAD_H__84A6839E_F348_4544_8D11_07BA328DA336__INCLUDED_) #define AFX_HTTPSDOWNLOAD_H__84A6839E_F348_4544_8D11_07BA328DA336__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include#include #include const UINT HS_LINK_OK = 0; const UINT HS_LINK_ERROR = 1; typedef struct HSDOWNLOADSTATE{ LONG range[20]; LONG threadsize[10]; LONG wcsize[10]; }HSDOWNLOADSTATE; class CHTTPSDownload { public: CHTTPSDownload(); virtual ~CHTTPSDownload(); 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 strHost; CString m_strSavePath; int m_nParts; int m_Port; DWORD m_dwFileSize; DWORD ss[10]; DWORD m_sum[10]; BOOL m_SupportResume; CString m_strTempSavePath; BOOL m_bResume; HSDOWNLOADSTATE m_state; HANDLE m_hThread[10]; HANDLE m_hNotify; BOOL m_bTerminate[10]; LONG m_index; int linkcode; }; #endif // !defined(AFX_HTTPSDOWNLOAD_H__84A6839E_F348_4544_8D11_07BA328DA336__INCLUDED_)