Boost下载地址

前世今生

开发时下载boost遇到国外下载太慢甚至下载失败,至此从朋友那里和网络收集了这些文件,希望对你有帮助。

boost_1_76_0集合

boost_1_76_0-msvc-14.2-64.exe
boost_1_76_0-msvc-14.2-32.exe
boost_1_76_0-msvc-14.1-64.exe
boost_1_76_0-msvc-14.1-32.exe
boost_1_76_0-msvc-14.0-64.exe
boost_1_76_0-msvc-14.0-32.exe
boost_1_76_0-msvc-12.0-64.exe
boost_1_76_0-msvc-12.0-32.exe
boost_1_76_0-msvc-11.0-64.exe
boost_1_76_0-msvc-11.0-32.exe
boost_1_76_0-msvc-10.0-64.exe
boost_1_76_0-msvc-10.0-32.exe

boost_1_75_0集合

boost_1_75_0-msvc-14.2-64.exe
boost_1_75_0-msvc-14.2-32.exe
boost_1_75_0-msvc-14.1-64.exe
boost_1_75_0-msvc-14.1-32.exe
boost_1_75_0-msvc-14.0-64.exe
boost_1_75_0-msvc-14.0-32.exe
boost_1_75_0-msvc-12.0-64.exe
boost_1_75_0-msvc-12.0-32.exe
boost_1_75_0-msvc-11.0-64.exe
boost_1_75_0-msvc-11.0-32.exe
boost_1_75_0-msvc-10.0-64.exe
boost_1_75_0-msvc-10.0-32.exe

boost_1_74_0集合

boost_1_74_0-msvc-14.2-64.exe
boost_1_74_0-msvc-14.2-32.exe
boost_1_74_0-msvc-14.1-64.exe
boost_1_74_0-msvc-14.1-32.exe
boost_1_74_0-msvc-14.0-32.exe
boost_1_74_0-msvc-12.0-64.exe
boost_1_74_0-msvc-12.0-32.exe
boost_1_74_0-msvc-11.0-64.exe
boost_1_74_0-msvc-11.0-32.exe
boost_1_74_0-msvc-10.0-64.exe
boost_1_74_0-msvc-10.0-32.exe

boost_1_72_0集合

boost_1_72_0-msvc-14.2-32.exe
boost_1_72_0-msvc-14.1-32.exe
boost_1_72_0-msvc-14.0-64.exe
boost_1_72_0-msvc-14.0-32.exe
boost_1_72_0-msvc-12.0-64.exe
boost_1_72_0-msvc-12.0-32.exe
boost_1_72_0-msvc-11.0-64.exe
boost_1_72_0-msvc-11.0-32.exe
boost_1_72_0-msvc-10.0-64.exe
boost_1_72_0-msvc-10.0-32.exe

boost_1_68_0集合

boost_1_68_0-msvc-14.0-32.exe
boost_1_68_0-msvc-12.0-64.exe
boost_1_68_0-msvc-12.0-32.exe
boost_1_68_0-msvc-11.0-64.exe
boost_1_68_0-msvc-11.0-32.exe
boost_1_68_0-msvc-10.0-64.exe
boost_1_68_0-msvc-10.0-32.exe
boost_1_68_0-msvc-9.0-64.exe
boost_1_68_0-msvc-9.0-32.exe
boost_1_68_0-msvc-8.0-64.exe
boost_1_68_0-msvc-8.0-32.exe

boost_1_64_0集合

boost_1_64_0-msvc-14.1-64.exe
boost_1_64_0-msvc-14.1-32.exe
boost_1_64_0-msvc-14.0-32.exe
boost_1_64_0-msvc-12.0-64.exe
boost_1_64_0-msvc-11.0-64.exe
boost_1_64_0-msvc-11.0-32.exe
boost_1_64_0-msvc-9.0-32.exe
boost_1_64_0-msvc-8.0-64.exe
boost_1_64_0-msvc-8.0-32.exe

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Boost库提供了一个非常方便的网络编程模块,包括FTP协议的实现。下面是一个使用Boost库实现FTP文件下载的示例代码: ```c++ #include <iostream> #include <fstream> #include <boost/asio.hpp> #include <boost/filesystem.hpp> #include <boost/algorithm/string.hpp> #include <boost/asio/read_until.hpp> #include <boost/asio/streambuf.hpp> #include <boost/asio/write.hpp> namespace asio = boost::asio; using asio::ip::tcp; using namespace boost::filesystem; class ftp_client { public: ftp_client(const std::string& host, const std::string& username, const std::string& password) : m_host(host) , m_username(username) , m_password(password) , m_socket(m_io_service) {} void download_file(const std::string& remote_file_path, const std::string& local_file_path) { try { connect(); login(); set_binary_mode(); std::string command = "RETR " + remote_file_path; tcp::iostream data_socket = send_command(command); std::ofstream local_file(local_file_path, std::ios::out | std::ios::binary); if (!local_file) { std::cout << "Failed to create local file: " << local_file_path << std::endl; return; } char buffer[1024]; while (data_socket.read(buffer, sizeof(buffer)).gcount() > 0) { local_file.write(buffer, data_socket.gcount()); } data_socket.close(); std::cout << "Successfully downloaded file: " << remote_file_path << std::endl; } catch (std::exception& e) { std::cout << "Error: " << e.what() << std::endl; } } private: void connect() { tcp::resolver resolver(m_io_service); tcp::resolver::query query(m_host, "21"); tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); asio::connect(m_socket, endpoint_iterator); std::cout << "Connected to FTP server: " << m_host << std::endl; } void login() { std::string response = receive_response(); std::string command = "USER " + m_username; send_command(command); command = "PASS " + m_password; send_command(command); std::cout << "Logged in as: " << m_username << std::endl; } void set_binary_mode() { send_command("TYPE I"); std::cout << "Set binary mode" << std::endl; } tcp::iostream send_command(const std::string& command) { m_socket << command << "\r\n"; std::string response = receive_response(); std::cout << "Sent command: " << command << std::endl; std::cout << "Received response: " << response << std::endl; std::vector<std::string> response_tokens; boost::split(response_tokens, response, boost::is_any_of(" ")); if (response_tokens[0][0] == '4' || response_tokens[0][0] == '5') { throw std::runtime_error("Failed to execute command: " + command); } std::string data_port_text = extract_data_port(response); tcp::iostream data_socket = connect_to_data_socket(data_port_text); return data_socket; } std::string receive_response() { asio::streambuf response_buffer; asio::read_until(m_socket, response_buffer, "\r\n"); std::string response((std::istreambuf_iterator<char>(&response_buffer)), std::istreambuf_iterator<char>()); boost::trim_right(response); return response; } std::string extract_data_port(const std::string& response) { int start = response.find("(") + 1; int end = response.find(")"); std::string data_port_text = response.substr(start, end - start); std::replace(data_port_text.begin(), data_port_text.end(), ',', '.'); return data_port_text; } tcp::iostream connect_to_data_socket(const std::string& data_port_text) { std::vector<std::string> data_port_tokens; boost::split(data_port_tokens, data_port_text, boost::is_any_of(".")); unsigned short port = std::stoi(data_port_tokens.back()); data_port_tokens.pop_back(); port += std::stoi(data_port_tokens.back()) * 256; data_port_tokens.pop_back(); port += std::stoi(data_port_tokens.back()) * 256 * 256; data_port_tokens.pop_back(); port += std::stoi(data_port_tokens.back()) * 256 * 256 * 256; tcp::resolver resolver(m_io_service); tcp::resolver::query query(m_host, std::to_string(port)); tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); tcp::iostream data_socket; asio::connect(data_socket, endpoint_iterator); std::cout << "Connected to data socket: " << data_port_text << std::endl; return data_socket; } std::string m_host; std::string m_username; std::string m_password; asio::io_service m_io_service; tcp::iostream m_socket; }; int main(int argc, char* argv[]) { if (argc < 4) { std::cerr << "Usage: " << argv[0] << " <host> <username> <password> <remote_file_path> <local_file_path>" << std::endl; return 1; } std::string host = argv[1]; std::string username = argv[2]; std::string password = argv[3]; std::string remote_file_path = argv[4]; std::string local_file_path = argc > 5 ? argv[5] : path(remote_file_path).filename().string(); ftp_client client(host, username, password); client.download_file(remote_file_path, local_file_path); return 0; } ``` 这个示例代码中,ftp_client 类封装了一些FTP协议相关的操作,如连接 FTP 服务器、登录、设置二进制模式、发送命令、接收响应等。其中,download_file() 方法实现了文件下载的功能,通过 RETR 命令获取文件数据,写入本地文件。 使用该示例代码下载文件只需要将 FTP 服务器的地址、用户名、密码、远程文件路径和本地文件路径作为命令行参数传入即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

找不到书包

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值