Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am learning C# to go towards my A-Level in computer science. My teacher has set me the task of making a programme with 3 triggers; one internal, one external and one we choose. I have done two, I just need to create the external one.

I want to be able to open up google, but neither of us can figure out why it isn't working.

What I have tried:

EVERYTHING!! (I think)

We have tried every possible solution online and nothing seems to work
Posted
Updated 21-Nov-20 1:43am

1 solution

Simplest way:
C#
Process.Start(@"D:\Test Data\APage.html");
Or:
C#
Process.Start(@"https://www.codeproject.com/Questions/5286855/How-do-I-open-Google-chrome-in-Csharp");


But if Chrome isn't the default browser, you need to be more specific:
C#
Process.Start("chrome.exe", @"https://www.codeproject.com/Questions/5286855/How-do-I-open-Google-chrome-in-Csharp");
And opening a file is more complex too:
C#
Process.Start("chrome.exe", @"file://D:\Test%20Data\APage.html");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900