如何清除.net的webbrowser控件中加载的文档的任何输入框 [英] How to clear any input box for the document loaded in the webbrowser control of .net

查看:112
本文介绍了如何清除.net的webbrowser控件中加载的文档的任何输入框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想清除.NET浏览器控件中加载的文档上可用的所有输入框

目前我正在关注

I want to clear all the input box available on the document loaded in the web browser control of .NET
Currently I am doing following

if (lhtmcollect.Count != 0)
                {

                    for (var i = 0; i < lhtmcollect.Count; i++)
                    {
                        if (lhtmcollect[i].InnerText != "")
                        {
                            lhtmcollect[i].InnerText = "";
                        }
                    }
                }





但它会抛出NOTSUPPORTEDEXCEPTION。我无法得到它。

下面的行是在WEbbrowsercontrol的Document_Completed方法中





but it throws NOTSUPPORTEDEXCEPTION. I am not able to get it.
Also below line is in Document_Completed method of WEbbrowsercontrol

lhtmcollect = wbrowser1.Document.Body.GetElementsByTagName("input");





如果上面的行在某些其他方法中是wriiten那么它显示Specified cast是无效的例外。



请帮帮我我搜索了很多但是找不到所需的解决方案,直到现在



if the above line is wriiten in some other method then it shows Specified cast is not valid exception.

Please help me I searched a lot but not find the required solution untill now

推荐答案

这篇关于如何清除.net的webbrowser控件中加载的文档的任何输入框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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