Does anybody has valuable information on how to do your own serialization methods using .net serialization objects for it?
thx :wave:
Printable View
Does anybody has valuable information on how to do your own serialization methods using .net serialization objects for it?
thx :wave:
What are you trying to serialize. I have serialized objects to memory streams and files. I think Wossy has something in the CodeBank or FAQ about that, but it seems to me that, largely due to the post-potluck, overstuffed, food-stupor I am currently in, I may be misunderstanding the question.
You may take a look here,
There is many info about Binary Serialization
http://msdn.microsoft.com/library/de...ialization.asp
nah, I've used binary & xml serialisations...
I was wondering if you could do your own... for instance serialize objets to something similar to ini files, html tables, rtf,
etc... how to model the serialisation?
Serialisation just refers to converting an object to a form that can be sent over a serial connection. If you want to use INI files or whatever then you'd just have to write to a file of that type. Microsoft has provided in-built mechanisms to help with binary and XML formats, which are the sensible options, but if you want to use other formats it just means that you have to do more of the low level work yourself.
Can you explain a bit more about what you want to end up with? If you were to use the standard serialization to serialize a class to a file, you have the option of doing custom serialization (selecting what does and does not get recorded). However, the result will always be 'roughly' the same: A file with a bunch of bytes in it that stores information about the class.
If you were to design such a file, your first thought might be to simply save all the data from the class in a fixed format such that you could read it back in in an orderly fashion. The next step might be to include sufficient information about the data in the class that something reading the file would be able to re-create the class itself (as opposed to just re-creating the data within a class).
However, that's all that serialization does. Whether this is serialized to XML or binary, that general pattern is present. What further capabilities are you looking for?
which is exacly what I've done since vb6 and lower versions, I was just wondering if it was possible serialize it to ini files..?Quote:
INI files or whatever then you'd just have to write to a file of that type.
Bah well, nevermind... I guess you just can't using the serialization objects... as you said I had to do them by myself...
:(