Hi alle zusammen
ich sitze derzeit an einem kleinem Projekt, von welchem ich noch nicht all zu viel erzählen möchte :P.
Prinzipiell ist die Anwendung fertig, leider gefällt mir die aktuelle Umsetzung nicht, da sie den User dazu auffordert auf im Webbrowser angezeige Buttons manuell zu klicken.
Also erst einmal bin ich mir auch überhaupt nicht sicher, ob es überhaupt möglich ist, link Adressen von Buttons auslesen zu lassen.
Als kleine Anmerkung ich benutze folgende klasse, um den Webbrowser gegen den etwas besseren Edge Browser auszutauschen.
Was ich doch noch anmerken möchte ist, dass ich mit der Webbrowser.DocumentText Funktion nicht weiter komme, da im Quelltext keine Links dargestellt werden.
Über Ansätze oder gute Ideen würde ich mich sehr freuen
Liebe Grüße Vortex
ich sitze derzeit an einem kleinem Projekt, von welchem ich noch nicht all zu viel erzählen möchte :P.
Prinzipiell ist die Anwendung fertig, leider gefällt mir die aktuelle Umsetzung nicht, da sie den User dazu auffordert auf im Webbrowser angezeige Buttons manuell zu klicken.
Also erst einmal bin ich mir auch überhaupt nicht sicher, ob es überhaupt möglich ist, link Adressen von Buttons auslesen zu lassen.
Als kleine Anmerkung ich benutze folgende klasse, um den Webbrowser gegen den etwas besseren Edge Browser auszutauschen.
VB.NET-Quellcode
- Namespace My
- Partial Friend Class MyApplication
- Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
- CreateBrowserKey()
- End Sub
- Private Sub MyApplication_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
- ' I don't like applications that defecate in the registry and then don't cleanup their own mess
- ' so remove the key
- RemoveBrowerKey()
- End Sub
- Private Const BrowserKeyPath As String = "\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"
- Private Sub CreateBrowserKey(Optional ByVal IgnoreIDocDirective As Boolean = False)
- Dim basekey As String = Microsoft.Win32.Registry.CurrentUser.ToString
- Dim value As Int32
- Dim thisAppsName As String = My.Application.Info.AssemblyName & ".exe"
- ' Value reference: http://msdn.microsoft.com/en-us/library/ee330730(v=VS.85).aspx
- ' IDOC Reference: http://msdn.microsoft.com/en-us/library/ms535242(v=vs.85).aspx
- Select Case (New WebBrowser).Version.Major
- Case 8
- If IgnoreIDocDirective Then
- value = 8888
- Else
- value = 8000
- End If
- Case 9
- If IgnoreIDocDirective Then
- value = 9999
- Else
- value = 9000
- End If
- Case 10
- If IgnoreIDocDirective Then
- value = 10001
- Else
- value = 10000
- End If
- Case 11
- If IgnoreIDocDirective Then
- value = 11001
- Else
- value = 11000
- End If
- Case Else
- Exit Sub
- End Select
- Microsoft.Win32.Registry.SetValue(Microsoft.Win32.Registry.CurrentUser.ToString & BrowserKeyPath,
- Process.GetCurrentProcess.ProcessName & ".exe",
- value,
- Microsoft.Win32.RegistryValueKind.DWord)
- End Sub
- Private Sub RemoveBrowerKey()
- Dim key As Microsoft.Win32.RegistryKey
- key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(BrowserKeyPath.Substring(1), True)
- key.DeleteValue(Process.GetCurrentProcess.ProcessName & ".exe", False)
- End Sub
- End Class 'MyApplication
- End Namespace
Was ich doch noch anmerken möchte ist, dass ich mit der Webbrowser.DocumentText Funktion nicht weiter komme, da im Quelltext keine Links dargestellt werden.
Über Ansätze oder gute Ideen würde ich mich sehr freuen
Liebe Grüße Vortex