Как бы я скачать все виды файлов с веб-сайта?

У меня есть следующий код в новом классе:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HtmlAgilityPack;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using System.Net;
using System.Web;
using System.Threading;
using DannyGeneral;
using GatherLinks;

namespace GatherLinks
{
    class RetrieveWebContent
    {
        HtmlAgilityPack.HtmlDocument doc;
        string imgg;
        int images;

        public RetrieveWebContent()
        {
            images = 0;
        }

        public List retrieveImages(string address)
        {
            try
            {
                doc = new HtmlAgilityPack.HtmlDocument();
                System.Net.WebClient wc = new System.Net.WebClient();
                List imgList = new List();
                doc.Load(wc.OpenRead(address));
                HtmlNodeCollection imgs = doc.DocumentNode.SelectNodes("//img[@src]");
                if (imgs == null) return new List();

                foreach (HtmlNode img in imgs)
                {
                    if (img.Attributes["src"] == null)
                        continue;
                    HtmlAttribute src = img.Attributes["src"];

                    imgList.Add(src.Value);
                    if (src.Value.StartsWith("http") || src.Value.StartsWith("https") || src.Value.StartsWith("www"))
                    {
                        images++;
                        string[] arr = src.Value.Split('/');
                        imgg = arr[arr.Length - 1];
                        wc.DownloadFile(src.Value, @"d:\MyImages\" + imgg);
                    }
                }

                return imgList;
            }
            catch
            {
                Logger.Write("There Was Problem Downloading The Image: " + imgg);
                return null;

            }
        }
    }
}

Приведенный выше код является частью моего WebCrawler. Этот код будет загружать только файлы изображений с веб-сайта.

Например, у меня есть этот сайт:http://web.archive.org/web/20131216195236/http://open-hardware-monitor.googlecode.com/svn/trunk/

На указанном выше сайте содержится файл с именемApp, Если я щелкните правой кнопкой мыши иsave asтогда я вижу, что этоs файл конфигурации. Если я нажму наHardware/ ссылку, тогда я вижу много файлов * .CS.

Как я могу создать и / или обновить свой код, чтобы он загружал все типы файлов, а не только изображения?

Ответы на вопрос(1)

Ваш ответ на вопрос