public static void UzipOneFile(string zipPath, string directoryOutPath) {
var outDir = new DirectoryInfo(directoryOutPath);
if (!outDir.Exists)
outDir.Create();
var archFile = new FileInfo(zipPath);
if(!archFile.Exists)
return;
using (var f = File.Open(archFile.FullName, FileMode.Open)){
System.IO.Compression.ZipArchive arch = new ZipArchive(f, ZipArchiveMode.Read);
if (arch.Entries.Count > 0){
using (Stream sr = arch.Entries[0].Open()){
var ext = "";
try{
ext = new FileInfo(arch.Entries[0].Name).Extension;
}
catch (Exception){}
using (Stream sw = File.Create(outDir.FullName + "\\" + archFile.Name+ext)){
while (true){
int data = sr.ReadByte();
if(data == -1)
break;
sw.WriteByte((byte) data);
}
}
}
}
}
}
//...
UzipOneFile(@"D:\myarch.zip", @"D:\outFolder");
P.S. Нужно добавить ссылку на System.IO.Compression