Getting the back/fwd history of the WebBrowser Control

社会主义新天地 提交于 2020-01-03 11:57:08

问题


In C# WinForms, what's the proper way to get the backward/forward history stacks for the System.Windows.Forms.WebBrowser?


回答1:


Check out http://www.bsalsa.com/downloads.html. This is a series of Delphi components (free source code, you can see an example of this here: http://staruml.cvs.sourceforge.net/staruml/staruml/staruml/components/plastic-components/src/embeddedwb.pas?revision=1.1&view=markup - it's the starUML projects code) and they have, among other things, a way to get at the history, favorites, etc using the IE MSHTML interfaces. It's written in Object Pascal but it shouldn't be too hard to figure out what's going on. If you download the "Embedded Web Browser Components Package" take a look at the stuff in EmbeddedWB_D2005\Source - there's all sorts of goodies there.




回答2:


It doesn't look like it's possible.

My suggestion would be to catch the Navigated event and maintain your own list. A possible problem with that is when the user clicks back in the browser, you don't know to unwind the stack.



来源:https://stackoverflow.com/questions/54758/getting-the-back-fwd-history-of-the-webbrowser-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!