In the past, using either C++ or VB (classic), I routinely stored records of
data as an array of structures, and then simply read and wrote them to and
from a file using basic file operations.
So now I'd like to do something similar with my first .NET application but I
really don't know where to start. I do not feel a database or XML file is
appropriate for this data. I simply want to read and write it to and from a
file in the most efficient manner.
Can anyone offer any examples or tips? Specifically, the questions that are
coming up include:
1. Should I still use structures or am I better off accepting any additional
overhead of using class objects to represent each record?
2. What is the best way to write structures or classes to disk?
3. What is the best way to write a collection of structures or classes to
disk?
4. How come most of the file and try...catch examples I've found seem
absolutely retarded to me? For example, most leave the line that opens the
file (the line most likely to fail) before try, outside of the try block?
What is the point of that?
Thanks.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com