c#怎么样把验证码指定在网页中的某个确切位置?
c#怎么样把验证码指定在网页中的某个确切位置? 谢谢了啊~~
2008-11-03 17:48

2008-11-04 16:06
2008-11-04 17:36
2008-11-04 18:33
程序代码: private object GetElement(IHTMLDocument2 doc, string obj)
{
object element = doc.all.item(obj, null);
object e = null;
IHTMLDocument2 tmpDoc = null;
if (element == null) //如果在当前页面的TopLevel中没有找到该元素,则到FRAME中找
{
for (int i = 0; i < doc.frames.length; i++)
{
object oFrameIndex = i;
tmpDoc = (IHTMLDocument2)((IHTMLWindow2)doc.frames.item(ref oFrameIndex)).document;
e = GetElement(tmpDoc, obj);
if (e == null)
continue;
else
break;
}
}
else
{
return element;
}
return e;
}
IHTMLDocument2 doc = (IHTMLDocument2)axWebBrowser1.Document;//取浏览器中网页对象
IHTMLElement el = (IHTMLElement)GetElement(doc, "account.verifyCode");//你得知道html中输入框的id
el.innerText="3t1b";

2008-11-05 13:27