控制文件下载
我正在使用 TWebBrowser 为我的程序构建一个更新程序。 OnCreate 时,TWebBrowser 导航到给定的 URL。要下载更新,用户需要单击链接。单击链接时会出现此弹出窗口:
所以我想知道是否可以:
- 绕过该弹出窗口并允许自动下载。
- 设置文件下载到的固定路径。
I am building an updater for my program with the use of a TWebBrowser. OnCreate the TWebBrowser navigates to the given URL. To download the update, the user is required to click a link. When the link is clicked this popup appears:
So I was wondering if it was possible to:
- Bypass that popup and allow for automatic download.
- Set a fixed path that the file would download to.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会使用 Indy 的
TIdHTTP
组件来实现此目的,例如:I would use Indy's
TIdHTTP
component for that, eg:TWebBrowser 不是您想要的,因为您没有显示活动的 HTML 内容。正如之前所说,还有许多其他选择。基本上你想要一个 HTTP 请求。
这是一个使用 WinInet 的非常简单的示例,需要根据您的需求(线程、状态消息等)进行调整。
TWebBrowser isn't what you want since you aren't displaying active HTML content. As was said before, there are numerous other options. Basically you want a HTTP request.
Here's a very simple example using WinInet, which will need to be adapted to your needs (threading, status messages and so-on).