How do I get the version attribute of a file?
I tried the "Version" prop but it gives me the same number for all files
My Code:
while (getNextEntry)
{
ZipEntry entry = inStream.GetNextEntry();
getNextEntry = (entry != null);
if (getNextEntry)
{
string fileType = Path.GetExtension(entry.Name);
string version = "unavailable"; // entry.Version.ToString();
// etc ...
}
}
This is correct behavior. I am not familiar with SharpZipLib, but in .zip format itself, field version contains version of PkZip software needed to extract this particular file (or version of software that created this file). And, as usually, entire zip file created with one tool, so such field will contain the same version.
Again, version in zip is not file version, but version of software that packed this file.
You can read more about zip format here (Main source of information about zip format).