I have a zip file (SomeZipFile.zip) and I created another zip file (by first extracting its contents and changing some text in sometextfile.txt and again compress).
Now the problem is entry.FullName with original zip returns paths with '/' and entry.FullName with copied zip file returns paths with '\'.
Can anyone please explain why is it so ? And how to compare paths irrespective of '/' or '\'
Thanks in advance
string CurrentArchive = @"SomeZipFileCopy.zip";
string requiredFile = @"SomeFolder/somefile.txt";
using (ZipArchive zip = ZipFile.OpenRead(CurrentArchive))
{
foreach (ZipArchiveEntry entry in zip.Entries)
{
if(entry.Equals(requiredFile))
Console.WriteLine(entry.FullName);
}
}