2020年5月6日 星期三

vb.net 用Webbrowser寫入到TextArea [Write into TextArea of Webbrowser]

<textarea rows="5" name="code" cols="80"></textarea>



1
2
3
4
5
6
7
8
9
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        For Each element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("textarea")

            If element.GetAttribute("name") = "code" Then element.SetAttribute("value", TextBox1.Text)

        Next

    End Sub

沒有留言:

張貼留言