我是 GeckoBrowser 的新手。问题出在我的SetText
方法中:
void SetText(string attribute, string attName, string value)
{
// Get a collection of all the tags with name "input";
HtmlElementCollection tagsCollection =
geckoWebBrowser1.Document.GetElementsByTagName("input");
foreach (HtmlElement currentTag in tagsCollection)
{
// If the attribute of the current tag has the name attName
if (currentTag.GetAttribute(attribute).Equals(attName))
{
// Then set its attribute "value".
currentTag.SetAttribute("value", value);
currentTag.Focus();
}
}
}
但我在这一行遇到错误:
HtmlElementCollection tagsCollection =
geckoWebBrowser1.Document.GetElementsByTagName("input");
错误是:
无法隐式转换类型“Skybound.Gecko.GeckoElementCollection” 到“System.Windows.Forms.HtmlElementCollection”
任何想法如何解决这个问题?