关于使用WebBrowser控件访问页面时,如何在点击链接时弹出VB窗体,并截获链接地址信息!

pjchuqi 2005-09-15 02:49:09
关于使用WebBrowser控件访问页面时,如何在点击链接(此链接地址为图片下载地址)时弹出VB窗体,并截获链接地址信息!
...全文
442 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
pjchuqi 2005-11-02
  • 打赏
  • 举报
回复
已解决,多谢各位!
蒋晟 2005-09-19
  • 打赏
  • 举报
回复
you can implement IDocHostUIHandler::GetExternal, and access your implementation by window.external, or use a custom protocol like MyApp::SomeCommand, and handle the protocol by handling DWebBrowser2::BeforeNavigate2, or through Asynchronous Pluggable Protocol.

The cleanest way of controlling these interesting aspects of the Webbrowser control is through implementing the IDocHostUIHandler interface, but you can't find an easy way to do this in VB6. So, how do you implement it? Will the only easy way in the pre .Net days was through VC++ and there is a sample of how it can be done up on the MS Support web site ( http://support.microsoft.com/support/kb/articles/Q183/2/35.ASP), and I found some guy worked very hard to translate this sample into VB ( http://www.topxml.com/code/default.asp?p=3&id=v20031122135204). However, this method is less satisfactory: the customization can not be done before DocumentComplete, because a full DHTML Document object is needed to access its ICustomDoc interface.

The better implementations are written in native C++, usually based on MFC or ATL. One of them is the driller sample ( http://msdn.microsoft.com/archive/en-us/samples/internet/browser/driller/default.asp), and the other is the MFC 8.0 implementation, while MFC 7.0 and 7.1 are buggy.

In .Net 1.0 and 1.1, you can implement the IDocHostUIHandler interface much easier (http://www.codeproject.com/csharp/advhost.asp), however, the implementation of the .Net wrapper of the WebBrowser control is almost unknown, so ICustomDoc is also required.

In .Net 2.0 (still in beta), the new WinForm WebBrowser control is much better, and is almost the same of the MFC 8.0 implementation. However, its implementation details are still almost unknown, but it would satisfy most of WebBrowser developers.
GHOSTSEA 2005-09-19
  • 打赏
  • 举报
回复
学习中,关注~~~~~~~~~
pjchuqi 2005-09-19
  • 打赏
  • 举报
回复
多谢,我先试一下,有不明白的再请教!
yas 2005-09-16
  • 打赏
  • 举报
回复
仅以nettransport为例
注册表:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\使用影音传送带下载
C:\Program Files\Xi\NetTransport 2\NTAddLink.html


NTAddLink.html 文件:
<script language = "VBScript">
'Download selected link

sub AddLink(Url, Remark)
On Error Resume Next

set NTIECatcher = CreateObject("NTIEHelper.NTIEAddUrl")
if err = 0 then
call NTIECatcher.AddLink(external.menuArguments.document.Url, Url, Remark)
end if

end sub
</script>

自己写个NTIEHelper.NTIEAddUrl类
到这里你该清楚了吧
hujiahuwei 2005-09-16
  • 打赏
  • 举报
回复
你是想学flashget那样吗?
xghim 2005-09-16
  • 打赏
  • 举报
回复
这样对在新窗口显示的不能判断。
rokky 2005-09-16
  • 打赏
  • 举报
回复
Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)

msgbox "你要访问的地址是:" & url

End Sub
pjchuqi 2005-09-15
  • 打赏
  • 举报
回复
这个访问页面是自己做出来的,有个思路是用javascript脚本来与VB程序交互,但不知如何交互,请高手指教 !
内容概要:本文围绕“可再生能源发电与电动汽车的协同调度策略”展开硕士论文级别的研究与复现工作,基于Matlab平台构建了高比例可再生能源接入背景下电力系统与电动汽车(EV)之间的多间尺度协同优化模型。研究重点在于应对风光发电不确定性,充分利用电动汽车作为移动储能单元的灵活充放电能力(含V2G技术),实现电网削峰填谷、提升新能源消纳效率与系统运行经济性。文中综合考虑了异质电动车集群特性、V2G过程中的损耗约束以及随机因素影响,采用如深度确定性策略梯度(DDPG)强化学习、混合整数线性规划(MILP)等先进优化算法进行求解,并通过基准模型对比验证了所提自适应调度策略在提升电网稳定性、降低运行成本方面的有效性。; 适合人群:具备一定电力系统基础知识、优化理论背景及Matlab编程能力的研究生、科研人员,以及从事新能源并网、智能电网调度、车网互动(V2G)等方向的工程技术人员。; 使用场景及目标:①学习并复现已发表高水平硕士论文中的协同调度建模方法与仿真流程;②掌握将深度强化学习(如DDPG)应用于虚拟电厂、电动汽车集群调度等复杂非线性决策问题的技术路径;③为开展新能源消纳、需求侧响应、微电网优化运行等相关课题的研究提供可复用的代码框架与创新思路参考。; 阅读建议:建议读者结合文中提供的完整Matlab代码与技术文档,深入理解模型构建逻辑、算法实现细节与参数设置依据,优先在Simulink/Matlab环境中运行并调试仿真案例,通过调整场景参数与算法超参,探究不同策略对调度效果的影响,从而深化对协同调度机制与智能优化方法应用的理解。

7,788

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧