私はこの質問のタイトルと同じキーワードでgoogleで検索しています。 一部のコードは、スタックオーバーフローリンクであっても、機能しないか複雑な説明ではありません。 リンク作業を1件見つかりましたhere。 しかし、そのコードの結果はページタイトルであり、URLではありません。 このコードを作成して現在のURLを取得するにはどうすればよいですか?ここ コード、別のフォーラムから、解決アクティブなタブの現在のURLを取得するchrome vb net?
'//Grab all the Chrome processes
Dim chrome() As Process = Process.GetProcessesByName("chrome")
'//Exit if chrome isn't running
If chrome.Length <= 0 Then Exit Sub
For Each chromeProcess As Process In chrome
'//If the chrome process doesn't have a window handle then ignore it
If chromeProcess.MainWindowHandle <> IntPtr.Zero Then
'//To find the tabs we first need to locate something reliable - the 'New Tab' button
Dim rootElement As AutomationElement = AutomationElement.FromHandle(chromeProcess.MainWindowHandle)
Dim condNewTab As Condition = New PropertyCondition(AutomationElement.NameProperty, "New Tab")
Dim elemNewTab As AutomationElement = rootElement.FindFirst(TreeScope.Descendants, condNewTab)
'//Get the tabstrip by getting the parent of the 'new tab' button
Dim tWalker As TreeWalker = TreeWalker.ControlViewWalker
Dim elemTabStrip As AutomationElement = tWalker.GetParent(elemNewTab)
'//Loop through all the tabs and get the names which is the page title
Dim tabItemCondition As Condition = New PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.TabItem)
For Each tabItem As AutomationElement In elemTabStrip.FindAll(TreeScope.Children, tabItemCondition)
Debug.WriteLine(tabItem.Current.Name)
Next
End If
Next
Awesomium(http://www.awesomium.com/#download)を使用してみましたか?これに関する詳細はこちら:http://stackoverflow.com/questions/1534843/google-chrome-control-for-net?lq=1 – Dustin
まだ、しかし、私はいくつかのトピックを読んで、それはWebブラウザを作るのが好きですVBネット、私が必要なのはクロムの現在のURLをキャプチャすることです。私に特定のリンクを教えてもらえますか? –