c++ - 什么 API 会启动 FTP 传输并向 GUI 报告状态?

标签 c++ c windows winapi ftp

想像 MFC 应用程序,只需一个按钮 - “下载”

  • 用户选择下载,然后提示输入文件的保存位置。
  • 连接到远程 ftp 服务器(登录名、ip、文件以获取所有硬编码)
  • 显示已下载文件量的状态栏。

哪个 Windows API 最能支持整个 C 或 C++ 应用程序? (希望尽可能简单明了)

最佳答案

  • User selects download and then is prompted for the location of where the file will be saved.

你有 Common File Dialog为了那个原因。 MFC 有一个包装器。

  • Connects to the remote ftp server (login, ip, file to GET all hard coded)

有 WinInet API,其中包括 FtpGetFile 等功能

  • Displays a status bar of how much of the file has been downloaded.

如果您需要报告进度,请使用 FtpOpenFile而是使用 InternetReadFile 读取 block 。 Windows 进度条由 CreateWindow 创建,并由 SendMessage 控制。

关于c++ - 什么 API 会启动 FTP 传输并向 GUI 报告状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7758353/

相关文章:

c - 函数返回后内存中的堆栈帧

windows - UpdateDriverForPlugAndPlayDevices 错误告诉我我*没有*做我正在做的事情

c++ - 如何运行所有子目录 CMakeList 文件并捕获输出?

c - 仅使用 "~ & ^ | + << >> ="个运算符和 20 个运算实现逻辑右移

c++ - 可以将参数类型转换为 std::min() 吗?

C - (C99),如何在不使用 stdlib.h(不使用 malloc)的情况下创建堆栈结构

windows - windows native docker有第三方私有(private)注册表吗?

Windows + Boot2Docker, 如何添加 D :\drive to be accessible from within docker?

c++ - 实现与 <<? 一起使用的有界字符串格式化运算符的有效方法

c++ - 打印没有嵌套条件的三角形