Geckowebbrowser和htmlelementcollection [英] Geckowebbrowser and htmlelementcollection

查看:442
本文介绍了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 - Error 1 Cannot implicitly convert type 'Skybound.Gecko.GeckoElementCollection' to 'System.Windows.Forms.HtmlElementCollection'
Any ideas how to work around this?
thank you

推荐答案

查看答案您在 stackoverflow 上的帖子[ ^ ]
See the answer to your post on stackoverflow[^]


这篇关于Geckowebbrowser和htmlelementcollection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆