繁体   English   中英

VB.net单击按钮即可从HTML表单中获取数据

[英]VB.net taking data from HTML form on click of a button

因此,在我的VB程序中,我需要产生一个HTML接口,该接口允许用户插入注释(然后将其存储在Access数据库中)。

到目前为止,我已经有了表格,但是在执行之后我没有任何实际线索:

classcontent.Write(<form action="comment_form.asp">Comment: <input type="text" name="comment"></input><br/><input type="submit" value="Submit"></input></form>)

因此,基本上,单击按钮时,我需要将插入到输入中的数据存储起来,然后刷新页面。

有任何想法吗?

我无法完全理解您的问题,但让我向您展示一个完整的示例,该示例将值提交到Web表单。

Dim myusername As String = txtuser.Text
Dim mypassword As String = txtpass.Text
Dim mycomments As String = txtcomments.Text
WebBrowser1.Document.GetElementById("username").SetAttribute("value", myusername)
WebBrowser1.Document.GetElementById("password").SetAttribute("value", mypassword)
WebBrowser1.Document.GetElementById("comment").SetAttribute("value", mycomments)
WebBrowser1.Document.Forms(0).InvokeMember("submit")

暂无
暂无

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

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