簡體   English   中英

在Webbrowser控件中提交表單,在Winform中獲得結果。 怎么樣?

[英]submit form in webbrowser control, get result in winform. how?

我有一個嵌入Web瀏覽器控件的Winform應用程序。 我在webbrowser控件中加載了html,在html中填寫了表單,然后單擊“提交”。問題是我需要能夠將提交的數據捕獲為winform應用程序中的變量。 id這可能嗎? 請幫我

您可以附加到按鈕點擊事件代碼:

var theButton = webbrowser1.Document.GetElementById("loginbutton")
theButton.Click += (sender, args) => { ... };

在處理程序中,您可以從以下位置獲取表單字段:

webbrowser1.Document

它使您可以在提交之前捕獲捕獲的表單。 當然,所有這些工作必須在DocumentCompleted Event中完成。

希望能幫助到你。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM