想像 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/