1. Get the document of the frame
Htmldocument htmldoc = webbrowser1.document;
Htmldoc = webbrowser1.document. Window. Frames ["frmrpt"]. Document;
"Frmrpt" is the name of IFRAME;
2. Get the source file of the frame.
MessageBox. Show (webbrowser1.document. Window. Frames ["Main"]. Document. Body. innerhtml );
3. Obtain the htmldocument interface of the frame.
Htmldocument Doc = (htmldocument) webbrowser1.document. domdocument;
Object J;
For (INT I = 0; I <Doc. parentwindow. frames. length; I ++)
{
J = I;
Htmlwindow2class frame = Doc. parentwindow. frames. Item (ref J) as htmlwindow2class;
If (frame. Name = "Main ")
{
Messagebox.show(frame.doc ument. Title );
}
}
4. Obtain the ihtmldocument2 interface of the frame.
Ihtmldocument2 Doc = (ihtmldocument2) webbrowser1.document. Window. Frames ["Main"]. Document. domdocument;
5. Get the clicked connection in the frame
Private void webbrowser1_navigating (Object sender, webbrowsernavigatingeventargs E)
{
String url = webbrowser1.document. Window. Frames ["Main"]. Document. activeelement. getattribute ("src ");
}