c# - UnZip files to the previous folder -
i using code extract files using ionic.zip.dll
using(zipfile zip = new zipfile("e:\\hello\\hi\\photos.zip")) { zip.extractall("e:\\hello\\hi\\", extractexistingfileaction.donotoverwrite); } this working fine , extracting : "e:\hello\hi\photos" folder, creating photos folder inside it.
here images in photos.zip folder extract , kept in new folder created "photos"
i want extracted "e:\hello\hi\" not photos folder.
using(zipfile zip = new zipfile("e:\\hello\\hi\\photos.zip")) { zip.flattenfoldersonextract = true; zip.extractall("e:\\hello\\hi\\", extractexistingfileaction.donotoverwrite); } try this, flattenfoldersonextract ignore possible folders in zip.
Comments
Post a Comment