Simplest possible key/value pair file parsing in .NET

前端 未结 5 1730
闹比i
闹比i 2021-01-17 19:07

My project requires a file where I will store key/value pair data that should be able to be read and modified by the user. I want the program to just expect the keys to be t

5条回答
  •  鱼传尺愫
    2021-01-17 19:34

    Use the KeyValuePair class for you Key and Value, then just serialize a List to disk with an XMLSerializer.

    That would be the simplest approach I feel. You wouldn't have to worry about traversing nodes. Calling the Deserialize function will do that for you. The user could edit the values in the file if they wish also.

提交回复
热议问题