-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFtpConnect.h
57 lines (44 loc) · 1.42 KB
/
FtpConnect.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// author: Yuriy Yazev, july 2015
#pragma once
#include <windows.h>
#include <WinUser.h>
#include <strsafe.h>
#include <wininet.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <iostream>
#include "SkinProgress.h"//skin progress bar
//#include "FileDownData.h"
//#include "ProgressCtrlST.h"//progress bar
using namespace std;
class CFtpConnect
{
private:
CWnd *hWin;
HINTERNET hHTTPInternet, hHTTPConnect;
HINTERNET hFTPInternet, hFTPConnect;
CSkinProgress *_TotalSkinProgress;
CRichEditCtrl *_percentText;
CRichEditCtrl *_speedText;
DWORDLONG g_downSize;//âñåãî ñêà÷àíî
LONG64 lastTime;//âðåìåííàÿ îòìåòêà
LONG64 lastDownload;//îòìåòêà êîëè÷åñòâà äàííûõ
public:
CFtpConnect();
CFtpConnect(CWnd *hwin);
virtual ~CFtpConnect();
bool WINAPI GetHttpFileToCreate(LPCWSTR file, DWORDLONG fileSize, DWORDLONG totalSize);
bool WINAPI GetFtpFileToCreate(LPCWSTR file, DWORDLONG fileSize, DWORDLONG totalSize, bool isTxt = false);
void setWin(CWnd *hwin) { hWin = hwin; }
void setTotalProgress(CSkinProgress *totalProg);
void setPercentText(CRichEditCtrl *text) { _percentText = text; }
void setSpeedText(CRichEditCtrl *text) { _speedText = text; }
void showPercentTotalStr(unsigned long iBytesRead, LONG64 totalSize);
DWORDLONG getDownSize();//âîçâðàùàåò êîëè÷åñòâî ñêà÷åííîãî
void createHTTPConnect();
void closeHTTPConnect();
void createFTPConnect();
void closeFTPConnect();
BOOL checkInternetConnect();
};