public Stream OpenFileAsStream(string strFileName)
        {
            strFileName = DiskReadZip_FilePacker._getFileLegalLowerDir(strFileName);
            if (string.IsNullOrEmpty(strFileName))
            {
                throw new ArgumentNullException(strFileName);
            }
            this.m_Conn = this.m_Packer.CheckConnection(this.Name);
            DiskReadZip_ConnectInfo conn = this.m_Conn;

            conn.Open();
            SharpCompress.Archive.Zip.ZipArchiveEntry findFile = null;
            foreach (var v in conn.ZipTarget.Entries)
            {
                if (v.IsDirectory)
                {
                    continue;
                }
                if (string.Compare(v.Key, strFileName, true) == 0)
                {
                    findFile = v;
                    break;
                }
            }
            if (findFile != null)
            {
                return(conn.GetUnCompressStream(findFile));
            }
            return(null);
        }
        public byte[] OpenFile(string strFileName)
        {
            strFileName = DiskReadZip_FilePacker._getFileLegalLowerDir(strFileName);
            if (string.IsNullOrEmpty(strFileName))
            {
                throw new ArgumentNullException(strFileName);
            }
            this.m_Conn = this.m_Packer.CheckConnection(this.Name);
            DiskReadZip_ConnectInfo conn = this.m_Conn;

            conn.Open();
            SharpCompress.Archive.Zip.ZipArchiveEntry findFile = null;
            foreach (var v in conn.ZipTarget.Entries)
            {
                if (v.IsDirectory)
                {
                    continue;
                }
                if (string.Compare(v.Key, strFileName, true) == 0)
                {
                    findFile = v;
                    break;
                }
            }
            byte[] buf = null;
            if (findFile != null)
            {
                using (MemoryStream ms = conn.GetUnCompressStream(findFile)) {
                    buf = ms.ToArray();
                    ms.Close();//关闭流
                }
            }
            return(buf);
        }
        /// <summary>
        /// 一般不使用吧,外面判断新文件名是否已经存在,不要'/'开头
        /// </summary>
        /// <param name="strFileName">相对目录路径名</param>
        /// <param name="strNewFile">相对目录路径名</param>
        public void RenameFile(string strFileName, string strNewFile)
        {
            strFileName = DiskReadZip_FilePacker._getFileLegalLowerDir(strFileName);
            strNewFile  = DiskReadZip_FilePacker._getFileLegalLowerDir(strNewFile);
            if (string.IsNullOrEmpty(strFileName) || string.IsNullOrEmpty(strNewFile))
            {
                return;                                                                       //名称不能为空
            }
            if (string.Compare(strFileName, strNewFile) == 0)
            {
                return;                                              //没有修改
            }
            this.m_Conn = this.m_Packer.CheckConnection(this.Name);
            DiskReadZip_ConnectInfo conn = this.m_Conn;

            //ToDo:
            conn.Open();
            SharpCompress.Archive.Zip.ZipArchiveEntry findfile = null;

            foreach (var ze in conn.ZipTarget.Entries)
            {
                if (ze.IsDirectory)
                {
                    continue;
                }
                if (string.Compare(ze.Key, strFileName, true) == 0)
                {
                    findfile = ze;
                    break;
                }
            }
            if (findfile != null)
            {
                //外面判断新文件是否存在
                MemoryStream ms = conn.GetUnCompressStream(findfile);
                conn.ZipTarget.AddEntry(strNewFile, ms, true, ms.Length, findfile.LastModifiedTime);
                conn.ZipTarget.RemoveEntry(findfile);
                findfile.Close();
            }
        }
        /// <summary>
        /// dir要规范,不要=='/',不要'/'开头,不要带'/'结尾
        /// </summary>
        /// <param name="strDirName"></param>
        /// <param name="strNewDirName"></param>
        public void RenameDir(string strDirName, string strNewDirName)
        {
            strDirName    = DiskReadZip_FilePacker._getFileLegalLowerDir(strDirName);    // +"/";//规范化
            strNewDirName = DiskReadZip_FilePacker._getFileLegalLowerDir(strNewDirName); // +"/";//规范化
            if (string.IsNullOrEmpty(strDirName) || string.IsNullOrEmpty(strNewDirName))
            {
                return;//根目录名称不能改
            }
            if (string.Compare(strDirName, strNewDirName) == 0)
            {
                return;//没有改名
            }
            strDirName    = strDirName + "/";
            strNewDirName = strNewDirName + "/";

            this.m_Conn = this.m_Packer.CheckConnection(this.Name);
            DiskReadZip_ConnectInfo conn = this.m_Conn;

            conn.Open();
            //修改所有的匹配目录名称
            List <SharpCompress.Archive.Zip.ZipArchiveEntry> olddirs    = new List <SharpCompress.Archive.Zip.ZipArchiveEntry>();
            List <SharpCompress.Archive.Zip.ZipArchiveEntry> filesInDir = new List <SharpCompress.Archive.Zip.ZipArchiveEntry>();

            foreach (var ze in conn.ZipTarget.Entries)
            {
                if (ze.IsDirectory)
                {
                    if (ze.Key.ToLower().StartsWith(strDirName))
                    {
                        olddirs.Add(ze);
                    }
                }
                else
                {
                    if (ze.Key.ToLower().StartsWith(strDirName))
                    {
                        filesInDir.Add(ze);
                    }
                }
            }
            //外面判断是否已经存在新目录名
            //改名
            string oldfName = "";
            string newfName = "";

            for (int i = filesInDir.Count - 1; i >= 0; i--)
            {
                oldfName = filesInDir[i].Key;
                newfName = filesInDir[i].Key.Remove(0, strDirName.Length);
                newfName = strNewDirName + newfName;
                //
                MemoryStream ms = conn.GetUnCompressStream(filesInDir[i]);
                conn.ZipTarget.AddEntry(newfName, ms, true, ms.Length, filesInDir[i].LastModifiedTime);
                conn.ZipTarget.RemoveEntry(filesInDir[i]);
                filesInDir[i].Close();
            }
            //移除老文件夹
            for (int i = olddirs.Count - 1; i >= 0; i--)
            {
                conn.ZipTarget.RemoveEntry(olddirs[i]);
                olddirs[i].Close();
            }
        }