How to quickly save/load class instance to file

后端 未结 7 1459
终归单人心
终归单人心 2020-12-09 05:33

I have several collections of classes/structs in my app.

The class is just a class with fields

class A
{
  public int somevalue;
  public string some         


        
7条回答
  •  死守一世寂寞
    2020-12-09 06:07

    You can serialize your List<> using XML serializer or Binary Serializer and save the serialized list into a file.

    Later , you can read this file content and retrieve your original list.

    Make your type for which you are creating list [Serializable]

提交回复
热议问题