日期:2014-05-17 浏览次数:21340 次
private void button1_Click(object sender, EventArgs e)
{
webBrowser1.DocumentCompleted+=new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
webBrowser1.Navigate("http://192.168.126.131/dvwa/login.php");
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser1.Document.GetElementById("username").InnerText = "admin";
webBrowser1.Document.GetElementById("password").InnerText = "password";
webBrowser1.Document.GetElementById("Login").InvokeMember("click");
webBrowser1.Navigate("http://192.168.126.131/dvwa/vulnerabilities/sqli/");
MessageBox.Show(webBrowser1.Url.ToString());
}