Пример #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);
        }
Пример #2
0
 /// <summary>
 /// Checks if the site is valid by checking a key value.
 /// </summary>
 /// <returns>If the loading of the site has been successful.</returns>
 private bool IsSuccessful()
 {
     return(webClientHandler.ContainsString(String.Format(URL_TEMPLATE, PostalNumber, PageNumber)));
 }
 /// <summary>
 /// Method for checking if the site is valid be checking a key string.
 /// </summary>
 /// <returns>Returns true if the site is valid.</returns>
 public bool IsSuccessful()
 {
     return(webClientHandler.ContainsString(TRIGGER_STRING));
 }