0

read title

Here is the code i'm using

System.Diagnostics.Process.Start("My url, dont wanna show it xd");

But visual studio tells this

screenshot

i tried using the light, but tells this

2 Answers2

1

You need to add a method to the click event before you can call the Process.Start. For instance:

button14.Click += Button14_Click;

Now if you click the button it will open the browser.

 private void Button14_Click(object sender, EventArgs e)
 {
    System.Diagnostics.Process.Start("my url");
 }
InputOutput
  • 61
  • 1
  • 5
-1

Have you tried

Process.Start("chrome.exe", "http://www.YourUrl.com");

Similar question here: How to launch a Google Chrome Tab with specific URL using C#

Farukh
  • 2,173
  • 2
  • 23
  • 38
  • This doesn't address why OP's code won't compile (considering `string filename` is an overload of [`Start`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.start?view=netframework-4.8#System_Diagnostics_Process_Start_System_String_)). – ProgrammingLlama Jan 27 '20 at 03:23