C#

using DotNetBrowser;
using DotNetBrowser.Events;
using DotNetBrowser.WPF;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace GetFrameIDsSample
{
    class Program
    {
        public class WindowMain : Window
        {
            private WPFBrowserView browserView;

            public WindowMain()
            {
                Browser browser = BrowserFactory.Create();
                browserView = new WPFBrowserView(browser);

                Content = browserView;

                Width = 1024;
                Height = 768;
                this.Loaded += WindowMain_Loaded;

                browser.FinishLoadingFrameEvent += delegate(object sender, FinishLoadingEventArgs e)
                {
                    if (e.IsMainFrame)
                    {
                        // Get HTML of each frame on the web page
                        PrintFrameHierarhy(browser, BrowserFrameID.MAIN_FRAME_ID);
                    }
                };
            }

            void WindowMain_Loaded(object sender, RoutedEventArgs e)
            {
                browserView.Browser.LoadURL("http://docs.oracle.com/javase/8/docs/api/");
            }

            public static void PrintFrameHierarhy(Browser browser, long frameId)
            {
                var framesIds = browser.GetFramesIds(frameId);
                foreach (var id in framesIds)
                {
                    String html = browser.GetHTML(id);
                    Console.WriteLine(id + " HTML = " + html);
                    PrintFrameHierarhy(browser, id);
                }
            }

            [STAThread]
            public static void Main()
            {
                Application app = new Application();

                WindowMain wnd = new WindowMain();
                app.Run(wnd);

                var browser = wnd.browserView.Browser;
                wnd.browserView.Dispose();
                browser.Dispose();
            }
        }
    }
}

VB.NET

Imports DotNetBrowser
Imports DotNetBrowser.Events
Imports DotNetBrowser.WPF
Imports System.Windows

Module GetFrameIDsSample
    Public Class WindowMain
        Inherits Window

        Private browserView As WPFBrowserView

        Public Sub New()
            Dim browser As Browser = BrowserFactory.Create()
            browserView = New WPFBrowserView(browser)
            Content = browserView
            Width = 1024
            Height = 768
            AddHandler Me.Loaded, AddressOf WindowMain_Loaded
            AddHandler browser.FinishLoadingFrameEvent, sub(ByVal sender As Object, ByVal e As FinishLoadingEventArgs)

                If e.IsMainFrame Then
                    'Get HTML of each frame on the web page
                    PrintFrameHierarhy(browser, BrowserFrameID.MAIN_FRAME_ID)
                End If
            End sub
        End Sub

        Private Sub WindowMain_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
            browserView.Browser.LoadURL("http://docs.oracle.com/javase/8/docs/api/")
        End Sub

        Public Shared Sub PrintFrameHierarhy(ByVal browser As Browser, ByVal frameId As Long)
            Dim framesIds = browser.GetFramesIds(frameId)

            For Each id In framesIds
                Dim html As String = browser.GetHTML(id)
                Console.WriteLine(id & " HTML = " & html)
                PrintFrameHierarhy(browser, id)
            Next
        End Sub

        <STAThread>
        Public Shared Sub Main()
            Dim app As Application = New Application()
            Dim wnd As WindowMain = New WindowMain()
            app.Run(wnd)
            Dim browser = wnd.browserView.Browser
            wnd.browserView.Dispose()
            browser.Dispose()
        End Sub
    End Class
End Module