c# - Extract specific subfolder from Zip -


i have zip file in root, contains 2 folders: binaries , source need binaries folder. have possible in c#? code have currently, not working.

using (ziparchive archive = zipfile.openread(zippath.fullname)) {      foreach (ziparchiveentry entry in archive.entries)      {         if (entry.fullname.startswith(@"binaries/", stringcomparison.ordinalignorecase))         {              entry.extracttofile(path.combine(extractpath, "hepper"));         }      } }  

update: gives me error file

'c:\hepper\hepper' exists.

at glance (without checkin api) looks trying extract entries same filename (path.combine(extractpath, "hepper")). you'd want have path , filename entry part of extracting to.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -