我有任何有4个文本框的网站
我需要在第2号文本框中插入“是”字样
我怎么能用C#winform代码做到这一点?
提前谢谢
答案 0 :(得分:1)
查看我的登录代码:
HtmlElementCollection trytologin = ((WebBrowser)sender).Document.GetElementsByTagName("input");
var usernameInput = (from HtmlElement input in trytologin where input.Name == "username" select input).Single();
var passwordInput = (from HtmlElement input in trytologin where input.Name == "password" select input).Single();
usernameInput.SetAttribute("value", "myusrname");
passwordInput.SetAttribute("value", "mypassword");