webbrowser登录 HtmlElementCollection hc = webBrowser1.Document.GetElementsByTagName("input"); foreach (HtmlElement h in hc) { if (h.OuterHtml.Contains("tbUserName")) { //MessageBox.Show("内容是" + h.OuterHtml.ToString()); h.SetAttribute("value", "zhushaolong");