serialize/deserialize a list of objects using BinaryFormatter
问题 I know there were already many discussions on that topic, like this one: BinaryFormatter and Deserialization Complex objects but this looks awfully complicated. What I'm looking for is an easier way to serialize and deserialize a generic List of objects into/from one file. This is what I've tried: public void SaveFile(string fileName) { List<object> objects = new List<object>(); // Add all tree nodes objects.Add(treeView.Nodes.Cast<TreeNode>().ToList()); // Add dictionary (Type: Dictionary