Form mshtml. Htmlformelementclass
IHTMLDocument2 mydocument= (IHTMLDocument2) web. Document;
by piece [by Piece]:ihtmlelement element
Object obj1 = Mydocument.all.item ("UG", 0);
if (Obj1 is IHTMLElement)
{
((IHTMLElement) obj1). Click ();
}
Object obj1 = Mydocument.all.item ("Betlist", 0);
if (Obj1 is IHTMLElement)
{
Datatext. Text= ((IHTMLElement) obj1). innertext;
}
input [Output]:ihtmlinputelement element
Object obj1 = Mydocument.all.item ("username", 0);
if (Obj1 is ihtmlinputelement)
{
((ihtmlinputelement) obj1). Value = "Set user name value";
}
Form Frame:htmlframeelementclass
Object obj1 = Mydocument.all.item ("main", 0);
if (Obj1 is Htmlframeelementclass)
{
obj1= (Htmlframeelementclass) obj1;
}
Opens a new page in the specified box: frame
Object obj1 = Mydocument.all.item ("main", 0);
if (Obj1 is Htmlframeelementclass)
{
((Htmlframeelementclass) obj1). ContentWindow.window.execScript ("document.location=" http://"+host+"/en-lang/ Underover/main.asp?t=l '; ', "JavaScript");
}
Gets the specified box and gets the value of the element and the source URL of the frame in the Source and box
Object obj1 = Mydocument.all.item ("main", 0);
if (Obj1 is Htmlframeelementclass)
{
Object obj2 = ((Htmlframeelementclass) obj1). ContentWindow.document.all.item ("Betlist", 0);
if (Obj2 is IHTMLElement)
{
Datatext. Text= ((IHTMLElement) obj2). innertext;//element value
Datatext. AppendText (((IHTMLElement) obj2). InnerHTML);//source
Datatext. AppendText (((Htmlframeelementclass) obj1). ContentWindow.location.href);//the Source URL in the box
}
}
This type of framework: IFRAME
Htmliframeclass
Object obj2 = ((Htmlframeelementclass) obj1). ContentWindow.document.all.item ("Maintt", 0);
Object obj3 = (mshtml. Htmliframeclass) obj2). ContentWindow.document.all.item ("Betlist", 0);
if (Obj3 is IHTMLElement)
{
Datatext. Text= ((IHTMLElement) obj3). innertext;
Datatext. AppendText (((IHTMLElement) obj2). InnerHTML);
Datatext. AppendText (URLSTR);
}
Document.formname.action=parent.yourpage;