日期:2014-05-17  浏览次数:20845 次

谁有c# 自解压程式 源码??
c盘有压缩文件 test.zip,有内容test.txt ,想解压至 d:\test.txt,求源码~~~也可以发至邮箱
y56075211@163.com ,3Q~
------最佳解决方案--------------------
用ICSharpCode.SharpZLib.dll
大概这样


                ZipInputStream zipInputStream = new ZipInputStream(File.OpenRead("test.zip"));

                ZipEntry zipEntry;
                while ((zipEntry = zipInputStream.GetNextEntry()) != null)
                {
                    string fileName = Path.GetFileName(zipEntry.Name);

                    FileStream streamWriter = null;

                    streamWriter = File.Create(fileName);

                    int size = 2048;
                    byte[] data = new byte[2048];
                    while (true)
                    {
                        size = zipInputStream.Read(data, 0, data.Length);
                        if (size > 0)
                        {
                            streamWriter.Write(data, 0, size);
                        }
                        else
                        {
                            break;
                        }
                    }
                    streamWriter.Close();