問題描述
有沒有一種方法可以在 Google Chrome 中啟動一個標簽(不是新窗口),并從自定義應用程序加載特定的 URL?我的應用程序是用 C# (.NET 4 Full) 編碼的.
Is there a way I can launch a tab (not a new Window) in Google Chrome with a specific URL loaded into it from a custom app? My application is coded in C# (.NET 4 Full).
我正在通過 C# 中的 SOAP 執行一些操作,一旦成功完成,我希望通過瀏覽器向用戶呈現最終結果.
I'm performing some actions via SOAP from C# and once successfully completed, I want the user to be presented with the end results via the browser.
整個設置用于我們的內部網絡,而不是供公眾使用 - 因此,我只能針對特定瀏覽器.由于各種原因,我只針對Chrome.
This whole setup is for our internal network and not for public consumption - hence, I can afford to target a specific browser only. I am targetting Chrome only, for various reasons.
推薦答案
作為對 chrfin 的響應的簡化,因為 Chrome如果安裝應該在運行路徑上,您可以調用:
As a simplification to chrfin's response, since Chrome should be on the run path if installed, you could just call:
Process.Start("chrome.exe", "http://www.YourUrl.com");
這對我來說似乎按預期工作,如果 Chrome 已經打開,則打開一個新標簽.
This seem to work as expected for me, opening a new tab if Chrome is already open.
這篇關于如何使用 C# 啟動具有特定 URL 的 Google Chrome 選項卡的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!