using System.Net; WebClient client = new WebClient(); string content = client.DownloadString("https://www.example.com"); bool containsHello = content.Contains("hello");
using System.IO; using System.Net; WebClient client = new WebClient(); client.DownloadFile("https://www.example.com/textfile.txt", "localfile.txt"); bool containsWord = File.ReadAllLines("localfile.txt").Contains("word");Package/library: System.Net.WebClient is a part of the .NET framework and does not require any additional packages or libraries.