这是代码:
public void WebBrowser wb;
public void Login(){
wb.Navigate("http://mywebsite.com/login.php");
wb.DocumentCompleted+=(o,e) => {
if (wb.ReadyState != WebBrowserReadyState.Complete) return;
var inputs = wb.Document.GetElementsByTagName("input");
inputs["username"].SetAttribute("value",account.Username);
inputs["password"].SetAttribute("value",account.Password);
if (wb.Document.Forms.Count==0) return;
wb.Document.Forms[0].InvokeMember("submit");
};
}
WebBrowser导航到网站,并正确填写表格 但是它没有提交?
为什么?