Try setting StartInfo.FileName to iexplore.exe and start info arguments to the URL.
Don't get a Process object when launch a Browser with Process.Start()
Pergunta
Windows 7 (64 bits); VB in VS2008 (WOW); .NET 3.51
Dim MyProcess As New System.Diagnostics.Process()
MyProcess.StartInfo.FileName = My.Resources.TARGET
MyProcess.Start() 'everything is copacetic to here
MyProcess.WaitForExit 'likewise if TARGET is a text file name,
'but not for URLs
When the TARGET is a URL, Start correctly launches the default browser (the UI of which does exactly what is expected), but WaitForExit throws this exception:
MyProcess.Close() 'fine for Notepad, never arrives here if IE or Firefox.
I haven't tested this much: I will check out other methods/properties of Process and report back. The code works fine with Notepad (and I gather from SO and other sites, with many other EXEs) and fails with both Firefox and IE. Why?
Ideas? Am I barking up the wrong tree?
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow