示例#1
0
        private void Parse(Uri uri, int depth)
        {
            if (uri == null)
            {
                throw new ArgumentNullException("uri is null");
            }
            if (depth < 0)
            {
                throw new ArgumentOutOfRangeException("wrong depth value");
            }

            if (Depth <= depth)
            {
                return;
            }
            if (MaxCount <= Count)
            {
                return;
            }
            var response = Request(uri);

            if (string.IsNullOrWhiteSpace(response))
            {
                return;
            }
            var EnumUri = Analyzer.CheckURI(response, uri, depth);

            Analyzer.Analisys(response, uri, depth);
            Analyzed.Add(uri);
            Count++;
            foreach (var item in EnumUri)
            {
                if (Analyzed.Contains(item))
                {
                    continue;
                }
                Parse(item, depth + 1);
            }
            return;
        }