-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript-zipped-datasets-downloader.cs
More file actions
72 lines (57 loc) · 1.93 KB
/
script-zipped-datasets-downloader.cs
File metadata and controls
72 lines (57 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace zip_down
{
static class Program
{
static void Main()
{
try
{
fileExtractor();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
static void fileExtractor()
{
try
{
DirectoryInfo d = new DirectoryInfo(@"C:\Users\hp\Desktop\street-hack\zip-files");
FileInfo[] Files = d.GetFiles();
foreach (FileInfo file in Files)
{
string zipPath = string.Format(@"C:\Users\hp\Desktop\street-hack\zip-files\{0}", file);
string extractPath = string.Format(@"C:\Users\hp\Desktop\street-hack\extracted-files\{0}", file);
System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, extractPath);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
static void fileDownloader()
{
WebClient webClient = new WebClient();
string[] lines = File.ReadAllLines(@"D:\zip-url.txt");
int count = 0;
foreach (string line in lines)
{
string myurl = line;
Console.WriteLine(line.Length);
string file_name = line.Substring(65, 17);
string file_path = string.Format(@"C:\Users\hp\Desktop\street-hack\zip-files\{0}", file_name);
webClient.DownloadFile(new Uri(myurl), file_path);
count++;
}
}
}
}