Hello I'm trying to make app that will open every time when I start pc. And the app will open some links in my browser (firefox). I tried Process.Start("http://www.google.com"); but it says "System.ComponentModel.Win32Exception: The system cannot find the file specified." Do someone know what code should I use to open link in Console application on a default browser?
Asked
Active
Viewed 615 times
0
-
You should document the OS version you use. Put the [STAThread] attribute on your Main() method and try again. – Hans Passant Dec 02 '20 at 22:59
2 Answers
1
You could try
string request = "https://www.google.com";
ProcessStartInfo ps = new ProcessStartInfo
{
FileName = request,
UseShellExecute = true
};
Process.Start(ps);
You will need to add
using System.Diagnostics;

Xavier
- 1,383
- 7
- 6
0
You will need to Add start
at start of you statement.
start https://www.google.com

Alen.Toma
- 4,684
- 2
- 14
- 31