Save Engine

I have several projects I am working on and one thing they all have in common is I need to be able to save clusters of data inside unique structures. On Saturday I started working on a C# class that should be able to do just that.

The strings are mainly there to clean up the other text and for making sure that when I want to change the variables then I will not have to hunt through the code, fairly standard stuff.

The first thing I had to check was to make sure the folder was currently there. I did want to allow the method to take different file names down the road so I pass the full path name to the Directory.Exists. If it does not find the folder then it will create it.

The second part of the method is the Stream writer that creates the text file (in this case) which then will write Testing file.. inside the document. You could easy use binary writer if you don’t want people looking into the document. At least the lazy people out!

Leave a Reply

Your email address will not be published. Required fields are marked *