Пример #1
0
        /// <summary>
        /// Method for returning the id of the persons as a list of strings.
        /// </summary>
        /// <param name="regex">The regular expression for extracting the id´s.</param>
        /// <returns>A list of id´s.</returns>
        public List <string> GetNextList(string regex)
        {
            List <String> list = new List <String>();

            do
            {
                Url = String.Format(URL_TEMPLATE, PostalNumber, PageNumber);
                WebClientHandler webClientHandler = new WebClientHandler(Url);
                list = webClientHandler.GetSiteContent(regex);
                PageNumber++;

                if (list.Count <= 0 || !webClientHandler.ContainsString(Url))
                {
                    PageNumber = 1;
                    PostalNumber++;
                }
            } while (PageNumber == 1);


            return(list);
        }
 /// <summary>
 /// Method for loading the url.
 /// </summary>
 /// <returns>If the loading of site has been successful.</returns>
 private bool LoadWebClientHandler()
 {
     Url = String.Format(URL_TEMPLATE, this.dataId);
     webClientHandler = new WebClientHandler(Url);
     return(IsSuccessful());
 }