使用WebBrowser控件,在documentComplete事件处理器里写
1 HtmlElement name = webBrowser1.Document.GetElementById("ctl00$content$loginname"); 2 if (name != null) 3 name.SetAttribute("value", User); 4 HtmlElement pass = webBrowser1.Document.GetElementById("ctl00$content$pwd"); 5 if (pass != null) 6 pass.SetAttribute("value", Password); 7 HtmlElement login = webBrowser1.Document.GetElementById("ctl00_content_summit"); 8 if (login != null) 9 login.InvokeMember("click");
就这么简单!