Upload 3,000+ images using C #?

I have a list of about 3,000 image URLs where I need to download them to my desktop.

I am a web developer, so naturally I wrote a small way to download asp.net C # to do this, but an obvious problem arose and the page was turned off before I almost got them.

I wonder if anyone knew of a good, fast and reliable way for me to iterate over the entire image URL and upload it to a folder? Open any offers, WinForms, batch file, although I am new to both.

Any help is much appreciated

+5
source share
6 answers

wget? URL, .

wget -i c:\list-of-urls.txt
+11

# ( Winforms, ), WebClient .

:

- #

WebClient

- Google #.

, , - HTML Agility Pack, , , - .

Edit

( , ), mbeckish answer .

+11

, , Orbit, , . (, )

. . , , . , , .. , .

+8

, HTML- img, URL-.

FireFox , .

+6

, , , , :

, 3000 -, . , URL , . , , .

, "" , , , .

#, WebClient . psuedo :

List<string> imageUrls = new List<string>();
imageUrls.Add(..... your urls from wherever .....)

foreach(string imageUrl in imagesUrls)
{
    using (WebClient client = new WebClient())
    {
        byte[] raw = client.DownloadData(imageUrl);

        .. write raw .. to file
    }
}
+1

WinForms, URL- Excel . , , -, , , . web.config( executeTimeout httpRuntime), WinForms, . , , WinForms, ind

0

All Articles