Reputation: 5444
I have Serialized
all the Dictionaries
in my application to a file. So when I open this file I can see lots of information regarding my class names and etc which have been saved with the file.
So is this safe? Will everybody be able to just open a saved file created by my application and see what classes I've used? Here is the method I've used to Serialize
my Objects.:
Serialization of two Dictionaries at once
What alternatives I have got to save my objects in my application to a file.
Upvotes: 0
Views: 115
Reputation: 1560
In my opinion, you shouldn't be afraid of it.. but it depends on your need. If you decide that it is important for you, I would recommend to store the data in some other place (remote storage).
You will have 3 alternatives for hiding the content:
So, if that is an importnant thing in your program, I think that the first method will be the best.
Upvotes: 1
Reputation: 14059
You can encrypt the file to hide it contents. So to read encrypted file you need to read it to the memory, decrypt and then pass to the deserialization Formatter
.
Upvotes: 2
Reputation: 2272
Yes, they will be able to see the structure of the serialized object (maybe if you serialize it to a binary file, it's a bit more difficult, it does not help much tho).
However, anyone can see your source code anyways, just think about .NET Reflector or ildasm
. I personally wouldn't worry about it, I don't see any problem with this.
Upvotes: 2