简体   繁体   English

webbrowser组件与网页的交互

[英]webbrowser component interaction with webpage

I have a windows form application with a browser component in it. 我有一个带有浏览器组件的Windows窗体应用程序。

My goal is to load a webpage and pass variable's from the webpage to the form. 我的目标是加载网页并将变量从网页传递到表单。 Maybe trough java script. 也许低谷的Java脚本。 But i cant find out if it is even possible to pass variable's from the webrowser component to the the rest of the form. 但是我无法找出是否有可能将变量从webrowser组件传递到表单的其余部分。

Load the web page with Webbrowser.Navigate() then get the html of the loaded page using the WebBrowser.DocumentText property. 使用Webbrowser.Navigate()加载网页,然后使用WebBrowser.DocumentText属性获取已加载页面的html。 You have to read this property after the page is loaded so use it in the DocumentCompleted handler. 加载页面后,您必须阅读此属性,因此请在DocumentCompleted处理程序中使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM