我用C#写的类库里要调用自动解压程序。在使用ICSharpCode提供的方法时(如下),执行“while ((theEntry = fileStream.GetNextEntry()) != null) ”时总是报错“Wrong Local header signature: 0x274CEFB0”。。不知是什么原因请问各位老大是怎样来解压缩文件。(ZIP或RAR)文件就行using System;
using System.IO;
using System.Web;
using System.Web.UI;
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.GZip;
using ICSharpCode.SharpZipLib.Checksums;    /// <summary>
    /// 压缩文件与解压缩的实现类
    /// </summary>
    public class WebCommpress
    {
        #region 解压缩文件
        /// <summary>
        /// 解压缩文件
        /// </summary>
        /// <param name="file">需要解压缩的文件全名</param>
        /// <param name="dir">解压到的目录,形式为@"c:\hello\"</param>
        public bool UnzipFile(string sourceFullFile, string tarDir)
        {
            ZipInputStream fileStream = new ZipInputStream(File.OpenRead(sourceFullFile));            try
            {
                if (!Directory.Exists(tarDir))
                    Directory.CreateDirectory(tarDir);                ZipEntry theEntry;
                string dirName = "";
                string fileName = "";
                int size = 2048;                while ((theEntry = fileStream.GetNextEntry()) != null)
                {
                    dirName = Path.GetDirectoryName(theEntry.Name);
                    fileName = Path.GetFileName(theEntry.Name);                    if (dirName != String.Empty && !Directory.Exists(dirName))
                        Directory.CreateDirectory(tarDir + dirName);                    if (fileName != String.Empty)
                    {
                        FileStream streamWriter = File.Create(tarDir + theEntry.Name);                        byte[] data = new byte[size];
                        while (true)
                        {
                            size = fileStream.Read(data, 0, data.Length);
                            if (size > 0)
                            {
                                streamWriter.Write(data, 0, size);
                            }
                            else
                            {
                                break;
                            }
                        }                        streamWriter.Close();
                    }
                }                fileStream.Close();
            }
            catch (Exception exx)
            {
                string strExx = exx.ToString();
                return false;
            }
            finally
            {
                fileStream.Close();
            }            return true;
        }
    }