通过上下文判断,总有不一样的元素,然后一级一级往下找
确实,不一样的地方能找到就是不知道这个代码怎么写,怎么能获取到指定的那个
mshtml.IHTMLDocument2 doc2 = (mshtml.IHTMLDocument2)Browser.Document;
mshtml.IHTMLElementCollection inputs = (mshtml.IHTMLElementCollection)doc2.all.tags("INPUT");
mshtml.HTMLInputElement input1 = (mshtml.HTMLInputElement)inputs.item("sfzmhm", 1);
//input1.readOnly = true;
//MessageBox.Show(input1.value);
mshtml.HTMLInputElement input2 = (mshtml.HTMLInputElement)inputs.item("syr", 0);
input2.value = "刘德华";
mshtml.IHTMLElement element2 = (mshtml.IHTMLElement)inputs.item("buttonOK", 0);
//不可用
//element2.outerHTML = "<input id="buttonOK" name="buttonOK" disabled="disabled" type="button" class="button" value="确定(F8)" onclick="formsubmit();">";
//可用
element2.outerHTML = "<input id="buttonOK" name="buttonOK" type="button" class="button" value="确定(F8)" onclick="formsubmit();">";