Webbrowser SetAttribute不起作用(密码字段)
HtmlElementCollection inputs = doc.GetElementsByTagName("input");
HtmlElement usr = inputs.GetElementsByName("username")[0];
usr.setAttribute("value", strUsername);
HtmlElement pwd = inputs.GetElementsByName("password")[0];
pwd.GotFocus += new HtmlElementEventHandler(pwd_GotFocus);
pwd.Focus();
void pwd_GotFocus(object sender, HtmlElementEventArgs e)
{
HtmlElement pwd = (HtmlElement)sender;
pwd.SetAttribute("value", strPassword);
}