2012-11-08 27 views
2

我試圖插入URL到Firefox的URL欄。VB.net插入URL到Firefox的url吧

我的代碼:

進口:

Imports NDde.Client 

代碼:

Dim dde As DdeClient = New DdeClient("Firefox", "WWW_GetWindowInfo") 
dde.Connect() 
Dim url As String = dde.Request("URL", Integer.MaxValue) 
dde.Disconnect() 

這個代碼回報(GET)的URL。

我怎樣才能插入的網址?

(我試圖用dde.Handle和findwindowex,但我不知道什麼是地址欄的類名(是的,我試過間諜++))

+1

你想打開網址嗎?或者你只是想把文本放在網址欄中嗎? – WozzeC

+1

我只想用我的網址替換當前網址,然後導航。 – Fumf

+0

@Fumf我想用firefox做同樣的事情。你有沒有找到解決這個問題的辦法?如果是,那麼請在此發佈您的答案並幫助我們。謝謝。 –

回答

0

嘗試。

'///Download NDDE library from here "http://ndde.codeplex.com/" 
'///Then add refrence NDde.dll in your project. 

Imports NDde.Client 'import NDde Client 

Button1 Click: 

Dim dde As New DdeClient("Firefox", "WWW_OpenURL") 'you can also use "Opera" instead of "Firefox" 
dde.Connect() 
Dim url As String = dde.Request("http://www.google.com", Integer.MaxValue) 'you can replace google.com with your desired URL. 
dde.Disconnect() 

它會在Firefox或Opera瀏覽器的URL欄中設置URL並對其進行導航。希望這會對你有幫助。