-1

So I have two ulong[] arrays, as well as two string List's.

How do I save these arrays and lists to a single file?

I've looked at basic serialization, but I'm not sure it works for multiple objects.

1 Answers1

-1

Using basic serialization should work, as long as the arrays and lists are members of the same object. When you serialize as per the example you linked to they will all be saved out to the same file.

If they currently exist as members of separate objects, you could make a new class which holds the variables too, just for the serialization. You will need to make sure those other objects are also marked with the Serializable attribute, as per this answer:

.NET Binary Serialize object with references to other objects . . . what happens?

Community
  • 1
  • 1