2013-01-12 59 views
0

我正在創建一個Windows窗體應用程序來跟蹤在我的瀏覽器中打開的URL,但瀏覽器可能包含許多選項卡。如何獲取在瀏覽器中打開的所有選項卡的URL?

我怎樣才能得到在同一時間使用C#打開的所有標籤的網址?

+1

什麼瀏覽器?你有什麼嘗試? –

+0

[Here](http://stackoverflow.com/questions/13307946/get-the-urls-of-opened-tabs-in-browser)和[here](http://stackoverflow.com/questions/7814027/我怎樣才能獲得 - 從Chrome瀏覽器打開頁面 - Firefox和Firefox)是一些例子。 – Brian

回答

0
  1. 獲取URL從Firefox和Opera:

    DdeClient dde = new DdeClient(browser, "WWW_GetWindowInfo"); 
    dde.Connect(); 
    string url = dde.Request("URL", int.MaxValue); 
    string[] text = url.Split(new string[] { "\",\"" }, StringSplitOptions.RemoveEmptyEntries); 
    dde.Disconnect(); 
    return text[0].Substring(1); 
    
相關問題