zip not Extracting to target directory
This is the code using (ZipFile zipnew = ZipFile.Read(strPath)) { foreach (ZipEntr开发者_JAVA百科y zenew in zipnew) { zenew.Extract(exPath); }
zenew.filename="c:\temp\images\fish2.jpg" exPath = "c:\temp\members\12\images"
I get this error The file C:\temp\Images\fish2.jpg already exists.
Hope to get a reply Thanks
It looks like you need to set the Overwrite flag to something. Here is an example:
using (ZipFile zipnew = ZipFile.Read(strPath)) { foreach (ZipEntry zenew in zipnew)
{
zenew.filename="c:\temp\images\fish2.jpg"
exPath = "c:\temp\members\12\images"
zenew.Extract(exPath, ExtractExistingFileAction.OverwriteSilently);
}
精彩评论