111,129
社区成员
发帖
与我相关
我的任务
分享
document = (HTMLDocument)webBrowser.Document;
foreach (IHTMLInputElement tempElement in document.getElementsByTagName("INPUT"))
{
System.Windows.Forms.MessageBox.Show(tempElement.name != null ? tempElement.name : "该输入框没有Name属性,该输入框ID为" + ((IHTMLElement)tempElement).id);
}
//IHTMLIFrameElement iframe = document.getElementsByTagName("IFRAME").item("abcFrame", null) as IHTMLIFrameElement;
IHTMLIFrameElement iframe = document.getElementById("abcFrame") as IHTMLIFrameElement;
if (iframe != null)
{
IHTMLDocument3 docinner = (iframe as HTMLFrameElement).contentWindow.document as IHTMLDocument3;
try
{
inputBox = docinner.getElementById("inputBoxName") as IHTMLInputElement;
System.Windows.Forms.MessageBox.Show(inputBox.name);
onConn();
}
catch(Exception ex)
{ System.Windows.Forms.MessageBox.Show(ex.Message); }
帮顶下 接分~