How to Read PageContent by URL Below function is used to get the page content by the URL Import the name Spaces using System.Text; using System.Net; public string readPageContent( string sURL) { WebClient objWebClient = new WebClient (); System.Text. UTF8Encoding objUTF8 = new UTF8Encoding (); String strRequestState; Byte [] PageHTMLBytes; try { PageHTMLBytes = objWebClient.DownloadData(sURL); return strRequestState = objUTF8.GetString(PageHTMLBytes); } catch ( Exception ex) { return strRequestState = "No page found..." ; } }
ASP.NET || Javascript || Dataobject || Code Solutions Free Open Source code for Developers