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的“错误”方式,那么正确的方法是什么?