public string GetPage(string url) { string data = string.Empty; WebClient webClient = null; try { webClient = new WebClient(); data = webClient.DownloadString(url); } catch (Exception e) { Console.WriteLine(e.Message); } return(data); }
public string GetPage(string url) { string data = string.Empty; //WebClient webClient = null; try { //webClient = new WebClient(); data = webClient.DownloadString(url); webClient.DownloadFile(url, url + ".htm"); } catch (Exception e) { Console.WriteLine(e.Message); } //if (webClient != null) //{ // webClient.Dispose(); //} return(data); }