Saving a Dictionary in C# - Serialization?

后端 未结 6 1702
逝去的感伤
逝去的感伤 2020-12-13 08:09

I am writing a C# application that needs to read about 130,000 (String, Int32) pairs at startup to a Dictionary. The pairs are stored in a .txt file, and are thus easily mod

6条回答
  •  伪装坚强ぢ
    2020-12-13 08:35

    Well, using a BinaryFormatter isn't really a safe way to store the pairs, as you can write a very simple program to deserialize it (after, say, running reflector on your code to get the type)

    How about encrypting the txt? With something like this for example ? (for maximum performance, try without compression)

提交回复
热议问题