取得目前瀏覽的頁面Url
Support List:
Opera : v11.61
FireFox : v3.6
IE : v8.0
Chrome : v17.0.963.79
取得URL的範例程式碼 :
http://search.babylon.com/?babsrc=HP_Prot
www.blogger.com/blogger.g?blogID=5292182488903802704#editor/target=post;postID=4259425615197380978
Get FireFox Service Fail!
"opera:about","Opera - [???? Opera]
輸出順序:
IE -> Chrome -> FireFox -> Opera
如果只想輸出某一個瀏覽器的Url,以下有四個函式在GetUrlFromBrowser類別裡面
GetIEUrl - void > String [ IE ] ( 如果沒有抓到URL,則回傳空字串 )
GetChromeUrl - void > String [ Chrome ] ( 如果沒有抓到URL,則回傳空字串 )
GetFireFoxUrl - void > String [ FireFox ] ( 如果沒有抓到URL,則回傳 Get FireFox Service Fail! )
GetOperaUrl - void > String [ Opera ] ( 如果沒有抓到URL,則回傳 Get Opera Service Fail! )
Support List:
Opera : v11.61
FireFox : v3.6
IE : v8.0
Chrome : v17.0.963.79
取得URL的範例程式碼 :
GetUrlFromBrowser gb = new GetUrlFromBrowser(); var urls = gb.GetAllBrowserUrl(); foreach (var s in urls) Console.WriteLine(s) ;範例輸出:
http://search.babylon.com/?babsrc=HP_Prot
www.blogger.com/blogger.g?blogID=5292182488903802704#editor/target=post;postID=4259425615197380978
Get FireFox Service Fail!
"opera:about","Opera - [???? Opera]
輸出順序:
IE -> Chrome -> FireFox -> Opera
如果只想輸出某一個瀏覽器的Url,以下有四個函式在GetUrlFromBrowser類別裡面
GetIEUrl - void > String [ IE ] ( 如果沒有抓到URL,則回傳空字串 )
GetChromeUrl - void > String [ Chrome ] ( 如果沒有抓到URL,則回傳空字串 )
GetFireFoxUrl - void > String [ FireFox ] ( 如果沒有抓到URL,則回傳 Get FireFox Service Fail! )
GetOperaUrl - void > String [ Opera ] ( 如果沒有抓到URL,則回傳 Get Opera Service Fail! )
類別庫下載 : 點我
沒有留言:
張貼留言