@echo off
set h=192.168.1.100
set u=ftpuser
set p=12345678
echo open %h%>ftp.txt
echo %u%>>ftp.txt
echo %p%>>ftp.txt
echo dir>>ftp.txt
echo bye>>ftp.txt
ftp -s:ftp.txt>ftpdir.txt
echo open %h%>ftp.txt
echo %u%>>ftp.txt
echo %p%>>ftp.txt
for /f "tokens=4" %%i in ('findstr "<DIR>" ftpdir.txt') do (
echo cd %%~i>>ftp.txt
echo dir>>ftp.txt
echo cd ..>>ftp.txt)
echo bye>>ftp.txt
ftp -s:ftp.txt>ftpfile.txt
notepad ftpfile.txt
用QFtp应该可以做到吧, 摘自Qt的帮助文档, QFtp::get()时将次二哥参数设置为0,之后收到 readyRead()后可以通过read()或readAll()读取到内存里。int QFtp::get ( const QString &file, QIODevice * dev = 0, TransferType type = Binary )
If dev is 0, then the readyRead() signal is emitted when there is data available to read. You can then read the data with the read() or readAll() functions.
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)