Simplest possible key/value pair file parsing in .NET

前端 未结 5 1723
闹比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:36

    if you want the user to be able to read and modify the file, i suggest a comma-delimited pair, one per line

    key1,value1
    key2,value2
    ...
    

    parsing is simple: read the file, split at newline or comma, then take the elements in pairs

提交回复
热议问题