I have this URL: URL from Google
When open link in new tab, the browser force me download it. After download, I get a text file named \"s\". But I want use C# acces
Since this question and my previous answer is fairly old now, a more modern answer would be to use HttpClient
from System.Net.Http
using System.Net.Http;
namespace ConsoleApp2
{
class Program
{
async static void Main(string[] args)
{
HttpClient client = new HttpClient();
string result = await client.GetStringAsync("https://example.com/test.txt");
}
}
}
If not within an async function, then:
string result = client.GetStringAsync("https://example.com/test.txt").Result;