How to compress files in .NET 1.1

て烟熏妆下的殇ゞ 提交于 2019-12-13 04:15:09

问题


I need to compress files in [*.zip] format in .NET 1.1. I don't want to use SharpZip for compression as I got random errors - "Access Denied" - when running it in .NET 1.1.

SharptZip will work properly only if I put the assembly on the GAC - which is not an option in my project. This is the problem. Check this: http://forums.asp.net/p/1139901/1839049.aspx#1839049


回答1:


You can use a command-line tool for zip. For example 7-Zip.




回答2:


You could grab the zlib dll and use .NET interop to call the compression functions (if i remember correctly, you could get away with just 2 calls, one for library initialization and one to compress the data). Beware that you'll run problems on 64-bit architectures if you use a 32-bit zlib dll and vice versa.




回答3:


You need to upgrade! .NET 1.1 is 6 years old now!




回答4:


If you have the option of using J#.Net libraries you should be able to use java zip api included in it.

Here is a sample code.



来源:https://stackoverflow.com/questions/216313/how-to-compress-files-in-net-1-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!