Avatar of james henderson
james henderson
Flag 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

8/22/2022 - Mon
kaufmed

So you want to serialize instances of this class to a file? Can you expand your explanation a tad?
Tapan Pattanaik

james henderson

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.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
kaufmed

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
james henderson

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