Results 1 to 7 of 7

Thread: Serialization

  1. #1

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Serialization

    Does anybody has valuable information on how to do your own serialization methods using .net serialization objects for it?

    thx

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    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

  3. #3
    Frenzied Member Zakary's Avatar
    Join Date
    Mar 2005
    Location
    Canada, Quebec, Montreal
    Posts
    1,654

    Re: Serialization

    You may take a look here,
    There is many info about Binary Serialization

    http://msdn.microsoft.com/library/de...ialization.asp
    Using VS 2010 on Fw4.0

  4. #4

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    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?

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    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

  7. #7

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    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...


    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width