using System.IO; FileStream fs = File.Create("example.txt"); fs.Close();
using System.IO; string content = File.ReadAllText("example.txt"); Console.WriteLine(content);
using System.Net; using (WebClient client = new WebClient()) { client.DownloadFile("https://example.com/example.txt", "example.txt"); }This code will download the file "example.txt" from the URL "https://example.com/example.txt" and save it in the current directory. Package Library: System.Net