Example #1
0
        public string GenericDownload(string Url, string Referrer = "")
        {
            // first, get the URL
            FileDownload dl = new FileDownload();

            dl.downloadMethod = DownloadMethod.Get;
            dl.SourceURL      = Url;
            if (Referrer != "")
            {
                dl.AddReferrer = true;
                dl.Referrer    = Referrer;
            }

            ExecuteDL(dl);

            StreamReader sr        = new StreamReader(dl.memStream);
            string       sBaseHTML = sr.ReadToEnd();

            sr.Close();

            return(sBaseHTML);
        }
Example #2
0
        //public string GenericDownload(string Url, bool onlyText=false)
        //{
        //  System.Windows.Forms.HtmlDocument doc = wbf.GetHtmlDocumentWithWebBrowser(Url, null, null, null, 60);
        //  if (doc == null || doc.Body == null || string.IsNullOrEmpty(doc.Body.InnerText)) return "";
        //  return onlyText?doc.Body.InnerText:doc.Body.OuterHtml;
        //}

        private void ExecuteDL(FileDownload dl)
        {
            dl.Execute();
        }