- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
using System;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Net;
class Data : IDisposable
{
public void Dispose() { }
MemoryStream MemStr;
public Data(string Url)
{
UnZipFile(Url);
}
MemoryStream DownloadData(string Url)
{
using (WebClient Wc = new WebClient())
{
MemStr = new MemoryStream(Wc.DownloadData(Url));
}
return MemStr;
}
void UnZipFile(string Url)
{
MemoryStream MemStr = DownloadData(Url);
using (GZipStream ZipStr = new GZipStream(MemStr, CompressionMode.Decompress))
{
byte[] P = new byte[ZipStr.BaseStream.Length];
ZipStr.BaseStream.Read(P, 0, P.Length);
FileStream Fs = new FileStream("TmpFile.zip", FileMode.OpenOrCreate, FileAccess.ReadWrite);
Fs.Write(P, 0, P.Length);
Fs.Flush();
}
}
}
class Program
{
static void Main()
{
while (true)
{
Console.Write("\nPlease, insert link to download ZIP-file >> ");
string Abc = Console.ReadLine();
using (Data Obj = new Data(Abc)) ;
}
}
}