You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.2 KiB
C++
56 lines
1.2 KiB
C++
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
/*
|
|
* File: FtpCLient.h
|
|
* Author: shjd
|
|
*
|
|
* Created on 2019年12月4日, 上午10:35
|
|
*/
|
|
|
|
#ifndef FTPCLIENT_H
|
|
#define FTPCLIENT_H
|
|
#include <QObject>
|
|
#include <QFile>
|
|
#include <QNetworkRequest>
|
|
#include <QNetworkAccessManager>
|
|
#include <QUrl>
|
|
#include <QNetworkReply>
|
|
#include <QByteArray>
|
|
#include <QMessageBox>
|
|
#include <QFileInfo>
|
|
#include <QDir>
|
|
#include <QDebug>
|
|
class FtpCLient:public QObject
|
|
{
|
|
Q_OBJECT
|
|
protected slots:
|
|
void finished_get(QNetworkReply * reply);
|
|
void finished_put(QNetworkReply * reply);
|
|
void loadError(QNetworkReply::NetworkError);
|
|
public:
|
|
FtpCLient();
|
|
void FtpGet(QString sor, QString dev);
|
|
void FtpPut(QString source, QString dev);
|
|
void FtpSetUserInfor(QString user, QString pwd);
|
|
void FtpSetHostPort(QString str, int port =21);
|
|
int FtpPutState();
|
|
int FtpGetState();
|
|
private:
|
|
QFile * m_gpFile;
|
|
QFile * m_ppFile;
|
|
QNetworkReply *m_pReply;
|
|
QNetworkAccessManager * m_pManager;
|
|
QUrl * m_pUrl;
|
|
int fileputstate;
|
|
int filegetstate;
|
|
|
|
|
|
};
|
|
|
|
#endif /* FTPCLIENT_H */
|
|
|