Imports CefSharp
Imports CefSharp.WinForms
Private ChromeBrowser As ChromiumWebBrowser
Public Sub New()
InitializeComponent()
Dim settings As New CefSettings()
CefSharp.Cef.Initialize(settings)
'main browser
ChromeBrowser = New ChromiumWebBrowser("https://www.miweb.com/")
Me.Controls.Add(ChromeBrowser)
ChromeBrowser.Visible = True
ChromeBrowser.Dock = DockStyle.Fill
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
AddHandler
ChromeBrowser.FrameLoadEnd, AddressOf ChromeBrowser_FrameLoadEnd
End Sub
Sub ChromeBrowser_FrameLoadEnd()
With ChromeBrowser
'Complete web form
Dim identifiers As List(Of Long) =
.GetBrowser.GetFrameIdentifiers()
For Each i As Long In identifiers
Try
Dim frame As CefSharp.IFrame = .GetBrowser.GetFrame(i)
frame.ExecuteJavaScriptAsync("document.getElementById('user').value='root';")
frame.ExecuteJavaScriptAsync("document.getElementById('paw').value='1234';")
frame.ExecuteJavaScriptAsync("document.getElementById('btgo').click();")
frame.ExecuteJavaScriptAsync("document.getElementById('user').value='root';")
frame.ExecuteJavaScriptAsync("document.getElementById('paw').value='1234';")
frame.ExecuteJavaScriptAsync("document.getElementById('btgo').click();")
Exit For
Catch ex As Exception
End Try
End With
End Sub
Hola amigo, cómo rayos hago para que aparezca en mi formulario? no lo entiendo, la página que pusiste, me descarga miles de archivos, pero no veo nada para trabajarlo con visual basic 2019. Saludos.
ResponderEliminar