0
Open a web site in C#
Hello, I have a Problem And I need you to solve it. I use C# to do an AI like Siri but in console And I don't know how we can do it to open a web site with C# Important : I don't do an web App but an app on console
7 Antworten
+ 2
If I understand correctly what you're trying to do, then probably HttpClient can help you.
https://zetcode.com/csharp/readwebpage/
+ 1
HttpClient is ... an http client and is for make http requests and get the response for futher app processing
+ 1
The you want open a browser with an url, right?
If its this, depends from the browser but all major browser support passing the url as argument for open that web page.
You can try to pass the full path of your browser (at example chrome) and as secondary params the url like:
Process.Start(pathToChromeExe, "https://www.google.com");
+ 1
Mathéo Right
0
But it even works if it’s not for html program ?
0
i want to do something like that
my code is below:
using System;
using System.Diagnostics;
namespace test
{
class Program
{
static void Main(string[] args)
{
Process.Start("https://www.google.com");
}
}
}
but that didn't work and i want to know how I can fix it
Thank you
0
Ok thank you if that work like that
I have just a question
As first param, I pass the path of my chrome app on my computer right ?