private WebsiteDataModel DownloadWebsite(string websiteUrl) { var output = new WebsiteDataModel(); var client = new WebClient(); output.WebsiteUrl = websiteUrl; output.WebsiteData = client.DownloadString(websiteUrl); return(output); }
private async Task <WebsiteDataModel> DownloadWebsiteAsync(string websiteUrl) { var output = new WebsiteDataModel(); var client = new WebClient(); output.WebsiteUrl = websiteUrl; output.WebsiteData = await client.DownloadStringTaskAsync(websiteUrl); return(output); }
private void ReportWebsiteInfo(WebsiteDataModel data) { txtResults.Text += $"{ data.WebsiteUrl } downloaded: { data.WebsiteData.Length } characters long.{ Environment.NewLine }"; }