Jak mogę pobrać wszelkiego rodzaju typy plików ze strony internetowej?

Mam następujący kod w nowej klasie:

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

                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;

            }
        }
    }
}

Powyższy kod jest częścią mojego WebCrawlera. Ten kod pobierze tylko pliki obrazów ze strony internetowej.

Na przykład mam tę witrynę:http://web.archive.org/web/20131216195236/http://open-hardware-monitor.googlecode.com/svn/trunk/

Zawarty w wyżej wymienionej witrynie jest plik o nazwieApp. Jeśli kliknę prawym przyciskiem myszy isave as, widzę, że to plik konfiguracyjny. Jeśli kliknę naHardware/ link, a następnie widzę wiele plików * .CS.

Jak mogę utworzyć i / lub zaktualizować mój kod, aby pobierał wszystkie rodzaje plików, a nie tylko pobierał obrazy?

questionAnswers(1)

yourAnswerToTheQuestion