FTP下载的进度?

mtj520 2011-09-19 03:14:42
我写了一个FTP下载的程序,直接调用ftpgetFile函数下载。但是这个函数我取不到下载的进度。
原先的逻辑是,想用getfilesize不断的去取当前下载的这个文件的大小。但是这种方法不行,文件在下载的过程中我用这个函数取不到大小,后面看了下网站上的知识,说可以用这个回调函数InternetSetStatusCallback 可以取到下载的信息与大小,之前没用过,请前辈赐教。我知道怎么设置回调,但是就在我自己写的回调函数中,怎么去实现实时的监控下载文件的大小!
...全文
340 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
shangwu_35 2012-01-21
  • 打赏
  • 举报
回复
先获得下载文件的大小,你接收数据的粒度,大小/粒度
chan70707 2011-12-05
  • 打赏
  • 举报
回复
最近也要写FTP,不知楼主解决没有,帮顶下
绿领巾童鞋 2011-11-04
  • 打赏
  • 举报
回复
楼上的,有没有比较好的C++MFC方面的教材
wyx100 2011-11-04
  • 打赏
  • 举报
回复
查一下ftp的相关资料,或者协议
mtj520 2011-11-04
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 jennyvenus 的回复:]
http://topic.csdn.net/t/20061222/18/5250179.html
[/Quote]
这个完全没懂。。。
用户 昵称 2011-10-19
  • 打赏
  • 举报
回复
http://topic.csdn.net/t/20061222/18/5250179.html
mtj520 2011-10-18
  • 打赏
  • 举报
回复
上面的完全看不明白。有没有这方面的例子啊!
oyljerry 2011-09-19
  • 打赏
  • 举报
回复
BOOL FtpGetFile(
IN HINTERNET hFtpSession,
IN LPCTSTR lpszRemoteFile,
IN LPCTSTR lpszNewFile,
IN BOOL fFailIfExists,
IN DWORD dwFlagsAndAttributes,
IN DWORD dwFlags,
IN DWORD dwContext
);

Retrieves a file from the FTP server and stores it under the specified file name, creating a new local file in the process.

Returns TRUE if successful, or FALSE otherwise. To get a specific error code, call GetLastError.
hFtpSession
Valid handle to an FTP session.
lpszRemoteFile
Address of a null-terminated string that contains the name of the file to retrieve from the remote system.
lpszNewFile
Address of a null-terminated string that contains the name of the file to create on the local system.
fFailIfExists
Boolean flag that indicates whether the function should proceed if a local file of the specified name already exists. If fFailIfExists is TRUE and the local file exists, FtpGetFile fails.
dwFlagsAndAttributes
File attributes and flags for the new file. Can be any combination of FILE_ATTRIBUTE_* and INTERNET_FLAG_* file attributes. See CreateFile for more information on FILE_ATTRIBUTE_* attributes, and see InternetOpenUrl for more information on INTERNET_FLAG_* flags.
dwFlags
Flag value that indicates the conditions under which the transfer occurs. Can be any of the FTP_TRANSFER_TYPE_* values. For a description of these values, see FtpOpenFile.
dwContext
Application-defined value that associates this search with any application data. This is used only if the application has already called InternetSetStatusCallback to set up a status callback function.
jsyren 2011-09-19
  • 打赏
  • 举报
回复
建议你仔细查一下ftp的相关资料,或者协议。。。。。。。。。
进度这个问题肯定是可以解决的。。。
我研究过ftp,不过现在不想去查了,你自己去查吧。。。。。。
内容概要:本文针对无刷直流电机驱动的电子机械制动(EMB)执行器,建立了考虑Stribeck摩擦特性的非线性耦合动力学模型,并在Simulink环境中完成了系统级仿真分析。研究综合集成了电机动力学、齿轮传动机构与制动执行机构的动力学特性,构建了高保真的机电一体化系统模型。重点引入Stribeck摩擦模型以精确描述低速工况下执行器内部存在的静摩擦、粘滞摩擦与库仑摩擦之间的过渡行为,有效提升了系统在启停、反向运动等瞬态过程中的动态响应仿真精度。通过多工况仿真验证了模型的有效性,能够准确反映摩擦引起的爬行、滞后与定位误差等非线性现象,为EMB系统的高性能控制算法设计(如摩擦补偿、滑模控制)与结构优化提供了高可信度的仿真平台。; 适合人群:从事汽车电子制动系统、电机驱动控制、机电系统建模与仿真研究的研究生、科研人员及工程技术人员,需具备扎实的机械动力学、自动控制理论基础和MATLAB/Simulink仿真能力。; 使用场景及目标:①用于高精度电子机械制动系统的设计验证与性能预测;②为消除摩擦非线性影响的先进控制策略(如自适应控制、智能控制)提供精确的被控对象模型;③深入探究Stribeck摩擦等非线性因素对系统动态性能(如响应延迟、稳态误差)的作用机理; 阅读建议:读者应结合提供的Simulink模型文件,深入剖析Stribeck摩擦模块的数学实现与参数辨识方法,建议通过改变输入指令(如阶跃、正弦)和负载条件进行对比仿真,以直观理解非线性摩擦对系统动态特性的影响。

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧