Skip navigation

Recently, I needed to download a lot of files that I had in a file on my computer, so I threw together a quick console program to download files given a text file with the URLs in it. It worked first time around perfectly, and Im quite proud of it, I think that other people could use this program, here is the source for it…

            List<string> files=new List<string>();

            System.Net.WebClient downloader = new System.Net.WebClient();


            string location=Console.ReadLine();

            StreamReader filereader = new StreamReader(location);


            while (!filereader.EndOfStream)





            foreach (string n in files)




                    Console.Write(“downloading file “+ n + “: “);

                    downloader.DownloadFile(n, Path.GetFileName(n));



                catch (Exception x)


                    Console.WriteLine(“failed, reason: “+ x.ToString());







its pritty self explanitory, and it did what I want it to, so I didnt really test it that much

Blogged with Flock

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: