2014-03-19 30 views
0

因此,使用我的VB程序,我需要生成一个允许用户插入注释(然后将其存储在访问数据库中)的HTML界面。VB.net从HTML表单上点击按钮获取数据

到目前为止,我已经得到了形式,但我没有实际线索后做什么:存储

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

所以基本上上的按钮,我需要插入输入数据的点击那么页面刷新。

任何想法?

+0

你的问题没有清除?你想填写这个表格并自动按提交按钮? – user934820

+0

在按下按钮时,我想要将文本框中的任何内容存储在变量中。 – Naffel

回答

1

我完全不理解你的问题,但让我来演示一个将值提交给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")