0
當使用默認瀏覽器打開一個URL,以下工作正常:使用的Process.Start打開與用戶名,密碼的URL,域名
Process.Start(@"https://www.reddit.com/r/zeronet")
這個工程一樣的「啓動」命令在安慰。但是,在the documentation中,此參數意味着文件名或應用程序。
一些舊的代碼我見過的URL作爲參數打開Internet Explorer打開的網址,但它採用的是ProcessStart對象:
Dim tempProcessObj As New ProcessObject(<location of IE on the machine>)
tempProcessObj.Domain = "Domain"
tempProcessObj.UserName = "UserName"
tempProcessObj.Password = new SecureString();
tempProcessObj.Arguments = "https://www.reddit.com/r/zeronet"
Process.Start(tempProcessObj)
此拋出一個異常,「系統無法找到文件指定「。這可能是因爲fileName參數意味着是文件或可執行位置。
所以,在此基礎上,我問:
- 如果URL通過的Process.Start(串)的支持,那麼爲什麼不在的Process.Start(的ProcessStartInfo)?
- 啓動URL時,不是可執行文件,是甚至相關的用戶名/密碼/域? (即是否有這種情況需要它?)
- 如果這是在默認瀏覽器中啓動URL的「錯誤」方式,那麼正確的方法是什麼?