Read Javascript variable from Web Browser control

后端 未结 6 751
攒了一身酷
攒了一身酷 2020-12-01 19:04

I am trying to read the value of a Javascript variable which is loaded and called from a WebBrowser control on my form.

Example:

index.html refers to a javas

6条回答
  •  情书的邮戳
    2020-12-01 19:40

    Take a look at the HtmlWindow Class. You can get an instance of it from WebBrowser.Document.Window. If your js variables have global scope, they will belong to the Window object, and should be accessible from WebBrowser.Document.Window.DomWindow in C#.

提交回复
热议问题