111,129
社区成员
发帖
与我相关
我的任务
分享
mshtml.IHTMLElementCollection IHEC = (mshtml.IHTMLElementCollection)Doc.all.tags("input");
foreach (mshtml.IHTMLElement item in IHEC)
{
if (item.innerText.ToString().Equals(innerText))
{
//item就是要找的元素
break;
}
}
mshtml.IHTMLElement Element ;
HTMLInputElement InputElement;
InputElement = Element as HTMLInputElement;//强制转换成HTMLInputElement类型的元素
InputElement.focus();//获取焦点
SendKeys.Send(Value);//输入值
就是用focus呀 两个基本没什么区别的