资源简介
QT开发的视频采集并定时上传到服务器例程
使用到了OpenCV库函数

代码片段和文件信息
#include
#include
#include
#include
#include “ftpput.h“
FtpPut::FtpPut(Qobject *parent)
: Qobject(parent)
{
iTimeOutSeconds = 10;
connect(&ftp SIGNAL(commandStarted(int)) this SLOT(ftpCommandStarted(int)));
connect(&ftp SIGNAL(commandFinished(int bool)) this SLOT(ftpCommandFinished(int bool)));
connect(&ftp SIGNAL(stateChanged(int)) this SLOT(ftpStateChanged(int)));
connect(&ftp SIGNAL(done(bool)) this SLOT(ftpDone(bool)));
}
bool FtpPut::connectServer(const QUrl &url QString userName QString passWord)
{
int iCount;
if (!url.isValid())
{
std::cerr << “Error: Invalid URL“ << std::endl;
return false;
}
if (url.scheme() != “ftp“)
{
std::cerr << “Error: URL must start with ‘ftp:‘“ << std::endl;
return false;
}
iCount = 0;
idFtpConnect = ftp.connectToHost(url.host() url.port(21));
while(iFtpState != 1)
{
if (iFtpState < 0)
return false;
QTest::qWait(100);
iCount++;
if(iCount > iTimeOutSeconds*10)
{
iFtpState = -10;
std::cerr << “Error: timeout!“ << std::endl;
}
}
// ftp.login();
iCount = 0;
idFtpLogin = ftp.login(userName passWord);
while(iFtpState != 2)
{
if (iFtpState < 0)
return false;
QTest::qWait(100);
iCount++;
if(iCount > iTimeOutSeconds*10)
{
iFtpState = -10;
std::cerr << “Error: timeout!“ << std::endl;
}
}
iCount = 0;
idFtpSetTransferMode = ftp.setTransferMode(QFtp::Active);
while(iFtpState != 3)
{
if (iFtpState < 0)
return false;
QTest::qWait(100);
iCount++;
std::cerr << “Time takes: “ << float(iCount)/10.0 << std::endl;
if(iCount > iTimeOutSeconds*10)
{
iFtpState = -10;
std::cerr << “Error: timeout!“ << std::endl;
}
}
return true;
}
bool FtpPut::disconnectServer()
{
int iCount;
iCount = 0;
idFtpClose = ftp.close();
while(iFtpState != 6)
{
if (iFtpState < 0)
return false;
QTest::qWait(100);
iCount++;
if(iCount > iTimeOutSeconds*10)
{
iFtpState = -10;
std::cerr << “Error: timeout!“ << std::endl;
}
}
return true;
}
bool FtpPut::changeDir(QString dstPath)
{
int iCount;
iCount = 0;
idFtpCD = ftp.cd(dstPath);
while(iFtpState != 4)
{
if (iFtpState < 0)
return false;
QTest::qWait(100);
iCount++;
if(iCount > iTimeOutSeconds*10)
{
iFtpState = -10;
std::cerr << “Error: timeout!“ << std::endl;
return false;
}
}
return true;
}
bool FtpPut::putFile(QString localFileName QString dstFileName)
{
int iCount;
file.setFileName(localFile
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 784 2013-05-13 17:13 GigeVideoSave\GigeVideoSave.pro
文件 18941 2013-05-14 14:46 GigeVideoSave\GigeVideoSave.pro.user
文件 3516 2013-08-02 11:26 GigeVideoSave\main.cpp
文件 6944 2013-05-13 18:05 GigeVideoSave\ftpput.cpp
文件 1157 2013-05-13 17:16 GigeVideoSave\ftpput.h
目录 0 2013-05-12 20:38 GigeVideoSave
----------- --------- ---------- ----- ----
31342 6
- 上一篇:TCP/UDP/ICMP/IGMP发包工具
- 下一篇:专门卸载软件的工具
相关资源
- USB.Over.Network.Server 注册机
- Uninstall_Cortana_WINCLIENT.CN.rar
- B/S 网上订餐系统
- 代码客:G-TcpServer(IOCP) 1.0 正式版及
- 用IdFTPServer写的一个FTPServer程序
- 视频处理控件TVideoGrabber.v6.7.5.For.Del
- Radmin Server-3.5 完美绿色破解版x32 x64通
- Linux版的telnet安装包telnet、telnet-serv
- Intel(R) 82579V网卡驱动for server20033
- 最好用的FTP服务器
- 基于IBM eserver x440+FAStT700+VMware的系统整
- IBM CAW for Microsoft Cluster Server 简介
- 飞康NSS、CDP力保Windows Server 2008数据迁
- 64bit.server2008或win10下安装git服务器
- VisualSVN Server 4.0.0 企业破解版
- 网上购物商城系统完整版
- Server 2008R2 AD服务器搭建图解
- Windows Server 2012 R2 上部署与安装AD域
- eServer z 系列服务器数据挖掘解决方案
- SAP Business One 中文版 + IBM eServer x 系列
- IBM eServer xSeries 445 EXP400在Linux下的双
- IBM eServer xSeries 365 EXP400在Windwos下的双
- IBM eServer xSeries 电信服务器
- 联想System X 3650 M5210RAID卡驱动 for ser
- WindowsServer2003.WindowsXP-KB926139-v2-x64-EN
- Wing FTP Server FTP服务器 v6.1.9
- Coinstor Backup Server数据容灾解决方案
-
HP Integrity Non
stop NS14000 Server产品手册 - telnet-server-0.17-25.i386.rpm
-
PCI Express ba
se Specification Revision 2.1
评论
共有 条评论