-1

But the problem is when I do Process.Start("https://google.com") there is a red line saying that =

The word process does not exist in the current context

The Code

case ("open google"):
    Say("opening google");
    Process.Start("https://www.google.com");
    break;

The red line is getting shown under of Process. And when I even write Process there is no suggestion.

Peter Csala
  • 17,736
  • 16
  • 35
  • 75

1 Answers1

0

I am not familiar with WebForms in particular, but it is uncommon to start a local process from a website. You need to consider that when you deploy this website you would start the process on the host server not on the clients computer.

When you only want to open a website I don't think Process.Start is the right choice here. I would recommend redirecting the user or opening the website in a new tab.

For a simple redirect you can use Response.Redirect("https://www.google.com") If you want to open a new tab instead I recommend reading this answer: https://stackoverflow.com/a/104881/16154479

René
  • 100
  • 1
  • 8