Exemple #1
0
        private string FetchHttpGet(string baseurl, string word, string message)
        {
            int retry = 0;

            FireLogMessage("START: " + message + word);

            HttpFetcher hf   = new HttpFetcher(baseurl + word);
            string      data = "";

            while (retry < 5)
            {
                data = hf.GetHttpHtml;

                if (data != null)
                {
                    break;
                }

                retry++;
                FireLogMessage("RETRY " + retry + " : " + message + word);

                Thread.Sleep(100);
                continue;
            }

            if (retry < 5)
            {
                FireLogMessage("SUCCESS: " + message + word);

                try
                {
                    return(data);
                }
                catch (Exception exp)
                {
                    return(null);
                }
            }
            else
            {
                FireLogMessage("FAILED: " + message + word);
                return(null);
            }
        }
        private string FetchHttpGet(string baseurl, string word, string message)
        {
            int retry = 0;
            FireLogMessage("START: " + message + word);

            HttpFetcher hf = new HttpFetcher(baseurl + word);
            string data = "";
            while (retry < 5)
            {
                data = hf.GetHttpHtml;

                if (data != null)
                    break;

                retry++;
                FireLogMessage("RETRY " + retry + " : " + message + word);

                Thread.Sleep(100);
                continue;
            }

            if (retry < 5)
            {
                FireLogMessage("SUCCESS: " + message + word);

                try
                {
                    return data;
                }
                catch (Exception exp)
                {
                    return null;
                }
            }
            else
            {
                FireLogMessage("FAILED: " + message + word);
                return null;
            }
        }