Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace PicsDownloader
- {
- public class StartUp
- {
- public static void Main()
- {
- Console.Write("File Path: ");
- var filePath = Console.ReadLine();
- var links = File.ReadAllLines(filePath);
- var regex = new Regex("\\\\?\\w+.txt");
- var filaName = string.Join("", regex.Match(filePath).ToString().Skip(1).Reverse().Skip(4).Reverse());
- var client = new WebClient();
- var count = 1;
- if (!Directory.Exists(filePath))
- {
- Directory.CreateDirectory($@"C:\{filaName}");
- }
- foreach (var link in links)
- {
- client.DownloadFile(link, $@"C:\{filaName}\{count}.jpg");
- count++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement