【问题标题】:Is it possible to override the HTTP functions in wxHtmlWindow?是否可以覆盖 wxHtmlWindow 中的 HTTP 函数?
【发布时间】:2010-03-31 19:18:46
【问题描述】:

我希望 wxHtmlWindow 使用 libcurl 而不是内部的 wxHTTP 类。

有没有简单的方法来做到这一点?如果没有,我至少可以更改用户代理 wxHtmlWindow 在访问页面时发送的内容吗?

【问题讨论】:

    标签: wxwidgets libcurl wxhtmlwindow


    【解决方案1】:

    我会创建一个类来管理我的 curl 会话。设置用户代理、cookie、要连接的服务器等。

    另外,我会让该课程能够将我从互联网上获得的页面保存到文件temp/web.htm

    然后我会使用类似的东西:

    htmlwin->LoadPage("temp/web.htm");
    

    其中htmlwinwxHtmlWindow

    这是我想到的第一件事,也许我可以想出更好的解决方案。

    编辑 1: 请参阅this link,因此请参阅在 C++ 类中包装 curl 的小示例

    【讨论】:

    • 这也是我最初的想法。但是 HTML 文档中引用的图像会发生什么?
    猜你喜欢
    • 2011-04-06
    • 1970-01-01
    • 2020-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-04
    • 2012-07-01
    • 1970-01-01
    相关资源
    最近更新 更多