Home > OS >  Visual Studio 2019 #c Redirect Not Working on process.start file cannot be found
Visual Studio 2019 #c Redirect Not Working on process.start file cannot be found

Time:01-24

System.Diagnostics.Process.Start("https://www.youtube.com/"); I am a beginner so I dont know much about visual studio and C# Error Message Here.

CodePudding user response:

Process.Start is used to run executable code, so you need to pass it an executable. For example:

// the @ escapes the backslash characters in the path to the Chrome executable
Process.Start(@"C:\Program Files\Google\Chrome\chrome.exe", "http://www.youtube.com");

Depending on how (or if) Chrome is installed on your system, you may even be able to just run:

Process.Start("chrome.exe", "http://www.youtube.com");
  •  Tags:  
  • Related