In addition to the
BinaryFormatter
class advised by Mika, loot at
Data Contract. It allows you to store/load not just an object but an arbitrary object graph which does not have to be a tree (hierarchical). Also, this method is very non-intrusive: you don't have to modify your data types in any way, not even access modifiers. All you do is adding attributes to types and members. Also, you can make a very reliable provisions for backup compatibility of your data with newer versions of the applications.
See:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[
^].
See also my past answers where I advocate this wonderful approach:
How can I utilize XML File streamwriter and reader in my form application?[
^],
Creating property files...[
^],
deseralize a json string array[
^].
—SA