Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Deserialization Problem

Deserialization Problem

Scheduled Pinned Locked Moved Visual Basic
questionjsonhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    THEMYTH
    wrote on last edited by
    #1

    Hi all, I have a serialization class with following procedures. Public Shared Sub Serialize(ByVal Obj As Object, ByVal FilePath As String) Dim fs As New FileStream(FilePath, FileMode.OpenOrCreate) Dim sf As New SoapFormatter sf.Serialize(fs, Obj) fs.Close() End Sub Public Shared Sub DeSerialize(ByRef Obj As Object, ByVal FilePath As String) Dim fs As New FileStream(FilePath, FileMode.Open) Dim sf As New SoapFormatter Obj = sf.Deserialize(fs) fs.Close() End Sub As it can be guessed, these methods are used for serializing and deserializing objects. I have a class to be serialized public class SampleClass Private Value as Integer Private Items As New ArrayList end Class When I serialize this class, the output will be shown like the data below. (That shows the class has been successfully serialized) (PLEASE IGNORE THE NAMES AND VALUES IN THE DATA - IT IS ONLY A SAMPLE) ..... ...... 6 <_Name id="ref-12">ID UniqueIdentifier true ...... ......(continues)... But when I try to deserialize a class (from the data file), only the "Private Value as Integer" variable is deserialized. How can I also deserialize an arraylist? Best Regards Emre YAZICI

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups