You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.some files success,they're all at the root dir,such as:"Test.txt"
2.some files error,they're all at subdirectory,such as : "Test\Test.txt";and return "Cannot find entry to delete" exception.
3.when i scan the source code,i find that it maybe can't find the specified file name in the dictionary updateIndex_ using the file name;but when i debug the program ,i find the file name is completly the same as the key;and i can also find the file using method FindEntry or GetEntry.
Could you provide some code that describes your problem?
Version 0.86 is not supported, have you tried using v1.0?
Here's my code for adding file to the compressed file:
using (var zipStream = File.Open(zipPath, FileMode.OpenOrCreate, FileAccess.ReadWrite,
FileShare.ReadWrite))
{
using (var zipFile = new ZipFile(zipStream))
{
zipFile.UseZip64 = UseZip64.On;
zipFile.IsStreamOwner = true;//the two properties have no effect
zipFile.BeginUpdate();
zipFile.Add(fileDataSource,entryName,CompressionMethod.Deflated);
//which inherited from the interface IStaticDataSource
zipFile.CommitUpdate();
zipFile.Close();
}
}
when I add a file at the root directory,it works,such as "Test.txt";but when I update a file at a sub-directory which exist an old one,it shows two files with the same name,and the length of the compressed file is doubled,such as "Test\Test.txt".
ps:I've tried to installed the nuget package to my program ,but it shows that it can't be installed to a .NetFramework version=4.0 , and my program is only allowed to use the version 4.0
thx for reply,I just found that the reason why I can't search a file inside a directory, is that I use a right slash(''),but the root recorded uses a left slash('/').when I replaced it ,I can correctly find out the file,and update or delete it.
Activity
piksel commentedon Dec 10, 2018
Could you provide some code that describes your problem?
Version 0.86 is not supported, have you tried using v1.0?
a405012187 commentedon Dec 11, 2018
Here's my code for adding file to the compressed file:
using (var zipStream = File.Open(zipPath, FileMode.OpenOrCreate, FileAccess.ReadWrite,
FileShare.ReadWrite))
{
using (var zipFile = new ZipFile(zipStream))
{
zipFile.UseZip64 = UseZip64.On;
zipFile.IsStreamOwner = true;//the two properties have no effect
zipFile.BeginUpdate();
zipFile.Add(fileDataSource,entryName,CompressionMethod.Deflated);
//which inherited from the interface IStaticDataSource
zipFile.CommitUpdate();
zipFile.Close();
}
}
when I add a file at the root directory,it works,such as "Test.txt";but when I update a file at a sub-directory which exist an old one,it shows two files with the same name,and the length of the compressed file is doubled,such as "Test\Test.txt".
ps:I've tried to installed the nuget package to my program ,but it shows that it can't be installed to a .NetFramework version=4.0 , and my program is only allowed to use the version 4.0
a405012187 commentedon Dec 11, 2018
btw,I can just find the DLL of 0.86 version,and v1.0 can only find a nuget-package which can not installed T^T
Is v1.0 don't support .net 4.0?
Grunkles commentedon Dec 12, 2018
You can open the package with any zip program (7zip, winrar, etc.). The DLL is in the lib\net45 folder.
Hope that helps!
piksel commentedon Jan 3, 2019
The issue you are experiencing might have been fixed by the PR above this comment, but unfortunately, no, .NET 4.0 is not supported.
You can get the Nuget package with the fixes here:
https://ci.appveyor.com/project/icsharpcode/sharpziplib/builds/21365536/job/ye2ljnut390yyxl8/artifacts
a405012187 commentedon Jan 11, 2019
thx for reply,I just found that the reason why I can't search a file inside a directory, is that I use a right slash(''),but the root recorded uses a left slash('/').when I replaced it ,I can correctly find out the file,and update or delete it.
piksel commentedon Jan 14, 2019
Glad you solved the issue!