本文介绍了Geckowebbrowser和htmlelementcollection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是geckobrowser的新手。问题是我有一个函数SetText
Hi, I`m new with geckobrowser. The problem is that I have a function 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();
}
}
所以此行显示错误
So this line show error
HtmlElementCollection tagsCollection = geckoWebBrowser1.Document.GetElementsByTagName("input");
错误是 - 错误1无法将类型'Skybound.Gecko.GeckoElementCollection'隐式转换为'System.Windows.Forms .HtmlElementCollection'
任何想法如何解决这个问题?
谢谢
Error is - Error1Cannot implicitly convert type 'Skybound.Gecko.GeckoElementCollection' to 'System.Windows.Forms.HtmlElementCollection'
Any ideas how to work around this?
thank you
推荐答案
这篇关于Geckowebbrowser和htmlelementcollection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!