|
-
Nov 22nd, 2005, 02:23 PM
#1
Thread Starter
Fanatic Member
Serialization
Does anybody has valuable information on how to do your own serialization methods using .net serialization objects for it?
thx
-
Nov 22nd, 2005, 03:43 PM
#2
Re: Serialization
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.
My usual boring signature: Nothing
 
-
Nov 22nd, 2005, 03:47 PM
#3
Re: Serialization
You may take a look here,
There is many info about Binary Serialization
http://msdn.microsoft.com/library/de...ialization.asp
-
Nov 22nd, 2005, 11:46 PM
#4
Thread Starter
Fanatic Member
Re: Serialization
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?
-
Nov 23rd, 2005, 12:14 AM
#5
Re: Serialization
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.
-
Nov 23rd, 2005, 10:28 AM
#6
Re: Serialization
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?
My usual boring signature: Nothing
 
-
Nov 23rd, 2005, 11:05 PM
#7
Thread Starter
Fanatic Member
Re: Serialization
INI files or whatever then you'd just have to write to a file of that type.
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..?
Bah well, nevermind... I guess you just can't using the serialization objects... as you said I had to do them by myself...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|