Nandaka.Common.ExtendedWebClient.DownloadData C# (CSharp) Method

DownloadData() public method

public DownloadData ( string address ) : byte[]
address string
return byte[]
        public new byte[] DownloadData(string address)
        {
            return base.DownloadData(CreateUri(address));
        }

Usage Example

Beispiel #1
0
        private Tuple<HtmlDocument, WebResponse> getPage(string url)
        {
            Tuple<HtmlDocument, WebResponse> result = null;
            ExtendedWebClient client = new ExtendedWebClient();
            int retry = 1;
            while (retry <= Properties.Settings.Default.RetryCount)
            {
                try
                {
                    var imagePage = client.DownloadData(url);
                    HtmlDocument doc = new HtmlDocument();
                    doc.LoadHtml(Encoding.UTF8.GetString(imagePage));
                    result = new Tuple<HtmlDocument, WebResponse>(doc, client.Response);
                    break;
                }
                catch (Exception ex)
                {
                    checkHttpStatusCode(url, ex);

                    ++retry;
                    if (retry > Properties.Settings.Default.RetryCount)
                    {
                        throw;
                    }
                }
            }
            return result;
        }
All Usage Examples Of Nandaka.Common.ExtendedWebClient::DownloadData