我正在使用一个网络浏览器把我录入脸书。 一切都可行,但问题是,当我援引纽特语时,我需要检查密码是否正确,但是,在援引纽特语之前,检查似乎根本就没有意义,因为查询代码是在援引后。
private void Facebook_Login(String username, String password)
{
webBrowser1.Url = new Uri("http://m.facebook.com");
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) Application.DoEvents();
HtmlElementCollection inputs = webBrowser1.Document.GetElementsByTagName("input");
foreach(HtmlElement input in inputs)
{
if (input.GetAttribute("name") == "email")
{
input.SetAttribute("value", "jamesjeffery@hotmail.co.uk");
}
if (input.GetAttribute("name") == "pass")
{
input.SetAttribute("value", "kelaroostj"); // dont worry that pass wont work lol.
}
if (input.GetAttribute("name") == "login")
{
input.InvokeMember("click");
}
}
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) Application.DoEvents();
HtmlElementCollection bs = webBrowser1.Document.GetElementsByTagName("b");
foreach(HtmlElement b in bs)
{
MessageBox.Show(b.InnerHtml);
}
Log_Message("Logged into Facebook with: jamesjeffery@hotmail.co.uk");
}