先以webBrowser1讀取網頁,檢視原始法內的html element id
private void autoLogin()
{
if ( webBrowser1.Document.GetElementById("id1") != null )
{
webBrowser1.Document.GetElementById("pid11::content").SetAttribute("value", "name");
Thread.Sleep(3000);
webBrowser1.Document.GetElementById("pid1t2::content").SetAttribute("value", "pass");
Thread.Sleep(3000);
HtmlElement MyButton = webBrowser1.Document.GetElementById("pid1:s3:logBtn");
Thread.Sleep(3000);
MyButton.InvokeMember("click");
}
}
沒有留言:
張貼留言