Avatar of james henderson
james hendersonFlag for United States of America

asked on 

c# file class that can be added to zip archive.

I have a console application that creates several text files on disk, then adds them to a zip file.

What I would like to do is:
1. create the files as "virtual" files, ie create a class for each file with name and contents
2. write these class files to a zip archive.

Any thoughts appreciated.
.NET ProgrammingC#

Avatar of undefined
Last Comment
james henderson
Avatar of kaufmed
kaufmed
Flag of United States of America image

So you want to serialize instances of this class to a file? Can you expand your explanation a tad?
Avatar of james henderson
james henderson
Flag of United States of America image

ASKER

hey, kaufmed, thanks for the reply.

I was thinking that I don't really need a physical file on disk if I can create a class with a name property and a content property (the other file properties are not useful to me).  I could create this class instead of a physical file, and then add it to a zip archive as if it was a physical
file.  I'm just not sure how to go about it.

If I create the  physical file then I would need to delete it after it is added to the zip archive.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of james henderson
james henderson
Flag of United States of America image

ASKER

kaufmed, you rock!  This works perfectly and is just what I was looking for.  Thanks for help.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo