Esempio n. 1
0
        /// <summary>
        /// Determines whether a WHOIS record is a redirect record to another WHOIS server.
        /// </summary>
        /// <param name="record">The record.</param>
        /// <param name="redirect">The redirect.</param>
        /// <returns></returns>
        public bool IsARedirectRecord(WhoisRecord record, out WhoisRedirect redirect)
        {
            var isARedirectRecord = false;

            redirect = null;

            if (record.Text.Contains("many different competing registrars"))
            {
                var reader  = new EmbeddedPatternReader();
                var pattern = reader.Read(GetType().Assembly, "Whois.Patterns.Redirects.Iana.txt");

                var tokenizer = new Tokenizer();

                var text = record.Text;

                var tokenResult = tokenizer.Parse <WhoisRedirect>(pattern, text);

                redirect = tokenResult.Value;

                isARedirectRecord = true;
            }


            return(isARedirectRecord);
        }
Esempio n. 2
0
        /// <summary>
        /// Determines whether a WHOIS record is a redirect record to another WHOIS server.
        /// </summary>
        /// <param name="record">The record.</param>
        /// <param name="redirect">The redirect.</param>
        /// <returns></returns>
        public bool IsARedirectRecord(WhoisRecord record, out WhoisRedirect redirect)
        {
            var isARedirectRecord = false;

            redirect = null;

            if (record.Text.Contains("many different competing registrars"))
            {
                var reader = new EmbeddedPatternReader();
                var pattern = reader.Read(GetType().Assembly, "Whois.Patterns.Redirects.Iana.txt");

                var tokenizer = new Tokenizer();

                var text = record.Text;

                var tokenResult = tokenizer.Parse<WhoisRedirect>(pattern, text);

                redirect = tokenResult.Value;

                isARedirectRecord = true;
            }

            return isARedirectRecord;
        }
Esempio n. 3
0
        /// <summary>
        /// Gets all the embdedded patterns in the assembly.
        /// </summary>
        /// <returns></returns>
        public IList <string> GetEmbeddedPatterns()
        {
            var reader = new EmbeddedPatternReader();

            return(reader.ReadNamespace(GetType().Assembly, "Whois.Patterns.Domains"));
        }
        /// <summary>
        /// Gets all the embdedded patterns in the assembly.
        /// </summary>
        /// <returns></returns>
        public IList<string> GetEmbeddedPatterns()
        {
            var reader = new EmbeddedPatternReader();

            return reader.ReadNamespace(GetType().Assembly, "Whois.Patterns.Domains");
        }