How Do I write individual strings, booleans, integers, images, audio files, video files, etc. to a .zip file using DotNetZip?




i'm trying rewrite c# .net winforms app uses filestream , binarywriter write individual items binary file , filestream , binaryreader read them binary file. i'm thinking using donetzip write items .zip file instead.

here's how wrote them filestream/binarywriter:

        private void writetobinary(string filepath)
        {
            filestream fs = new filestream(filepath, filemode.create, fileaccess.write);
            binarywriter bw = new binarywriter(fs);

            bw.write(somestring);
            bw.write(someinteger);
            bw.write(someboolean);
            bw.write.(somejpgimageinbase64string();
            bw.write(somemp3inbase64);

            fs.close();
            bw.close();
        }


here's i'd do:

        private void zipitall(string filepath)
        {
            create new instance of ionic.zip or other zip method;
            add somestring it;
            add someinteger it;
            add someboolean it;
            add somejpgimageinbase64string it;
            add somemp3inbase64string it;
            write whole thing .zip file;
            call day;
        }

dotnetzip have functionality support step-by-step outlined in zipitall()? code examples can find whole files added 1 one , whole thing written .zip.

does dotnetzip have functionality support step-by-step outlined in zipitall()? code examples can find whole files added 1 one , whole thing written .zip.

have asked in dotnetzip discussion group?

https://dotnetzip.codeplex.com/discussions

- wayne



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user