Unlock zip file after extracting files using ionic.zip and C# -
i tried use files inside zip unlocked ionic.zip in c#
i using
string ziptounpack = filename; extractfiletodirectory(filename,apppath); first time works fine, try second time , io exception saying file been used user. how can unlocked file current process?
i cannot seem find extractfiletodirectory in ionic.zip's reference documentation. did find function same name in stackoverflow question, "extract zip file programmatically dotnetzip library?". if implementation using, need call dispose on zipfile close underlying file streams.
public void extractfiletodirectory(string zipfilename, string outputdirectory) { using (zipfile zip = zipfile.read(zipfilename)) { directory.createdirectory(outputdirectory); zip.extractall(outputdirectory,extractexistingfileaction.overwritesilently); } } if not, share more details how extracting files.
Comments
Post a Comment