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
Post a Comment