示例#1
0
        public static void SaveUnsupportedData(string filePath)
        {
            if (String.IsNullOrEmpty(filePath))
            {
                throw new ArgumentNullException("filePath");
            }
            LexiaConnector connector = new LexiaConnector();

            using (ZipOutputStream zipStream = new ZipOutputStream(
                       new FileStream(filePath, FileMode.Create)))
            {
                zipStream.SetLevel(3);
                zipStream.Password = "******";
                //zipStream.UseZip64 = UseZip64.Off;

                foreach (string fileName in connector.GetUnsupportedFileNames())
                {
                    string   entryNm = ZipEntry.CleanName(fileName);
                    ZipEntry entry   = new ZipEntry(entryNm);
                    entry.DateTime = DateTime.Now;
                    //entry.AESKeySize = 128;
                    zipStream.PutNextEntry(entry);
                    byte[] buffer = new byte[4096];
                    using (FileStream streamReader = File.OpenRead(fileName))
                    {
                        StreamUtils.Copy(streamReader, zipStream, buffer);
                    }
                    zipStream.CloseEntry();
                }
                zipStream.IsStreamOwner = true;
                zipStream.Close();
            }
        }
        private static IEnumerable <string> GetUnsupportedFiles()
        {
            LexiaConnector connector = new LexiaConnector();

            foreach (string name in connector.GetUnsupportedFileNames())
            {
                yield return(name);
            }
            foreach (string name in unsupportedFilePaths)
            {
                yield return(name);
            }
        }