Click here to Skip to main content
14,980,532 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everyone

I have made a browser with cefsharp chromium and want to save html or to open it on textbox.

Tried:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    browser.ViewSource()
End Sub

And after that, html is like i want, outputed on a notepad file at temp data with a randnom name.
I want to save him automatically at ex. "C:\" with a name.htm (txt) OR to see it on a textbox, or to find what name will have this txt on tempdata.

Hope to find a solution, Please help me. Thanks :)

What I have tried:

Imports CefSharp.WinForms
Imports CefSharp

Public Class Form1

    Private WithEvents browser As ChromiumWebBrowser

    Public Sub New()
        InitializeComponent()

        Dim settings As New CefSettings
        CefSharp.Cef.Initialize(settings)

        browser = New ChromiumWebBrowser("url") With {
            .Dock = DockStyle.Fill
        }
        Panel1.Controls.Add(browser)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        browser.ViewSource()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        browser.Load(TextBox1.Text)
    End Sub

End Class
Posted
Updated 21-Jun-21 5:00am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900