This article is a mirror article of machine translation, please click here to jump to the original article.

View: 30554|Reply: 2

[Source] .net/c# to get the file information in the zip package

[Copy link]
Posted on 6/11/2018 5:27:01 PM | | | |


Framework 4.5 support
References:System.IO.Compression.dll,System.IO.Compression.FileSystem.dll



The above method is limited to the zip compression algorithm!! Unable to extract rar compression to file!

As shown in the figure above, we can get the file name, file last modification time and file size without unzipping the zip package.





Previous:Bootstrap Tags tag input box
Next:Uh-huh, eh-huh, eh-huh
 Landlord| Posted on 6/13/2018 10:11:55 AM |
Another solution:

nuget command:



\packages\7-Zip.x64.16.02.1\tools directory, 7z.dll of which cannot be directly referenced!



Attach the code!


Both the test rar and zip files can be read normally!
 Landlord| Posted on 6/13/2018 1:14:34 PM |
Small slag Posted on 2018-6-13 10:11
Another solution:

nuget command:
SevenZip.SevenZipLibraryException: Can not load 7-zip library or internal COM error! Message: failed to load library.

If the above error appears, it may be that the dll version is not loaded correctly, and the running process should be judged, and then the corresponding load should be made, the code is as follows:




Finally, attach the 7z com library containing x86 and x64 bit dll files

7z.rar (931.49 KB, Number of downloads: 0, 售价: 3 粒MB)
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com