Get back a binary serialized object from a file stored into my resources

  • Thread starter Thread starter pamela fluente
  • Start date Start date
P

pamela fluente

I have serialized (Binary Formatter) an object of mine into a file.I
have added that file to my resources.
How do I get back the object within my program.

I tried intuitively this, but it's wrong (no error but gets Nothing):

Dim m As MyLittleObject =
CType(My.Resources.ResourceManager.GetObject("MyLittleObject"),
MyLittleObject)

What the right way?

-P
 
Pamela,

If you used a binary formatter's Serialize method to serialize an object to
a file, then you need to use a binary formatter's Deserialize method to
deserialize the file to an object.

Kerry Moorman
 
Pamela,

If you used a binary formatter's Serialize method to serialize an object to
a file, then you need to use a binary formatter's Deserialize method to
deserialize the file to an object.

Kerry Moorman

Ah ok, Kerry,

I was assuming it might be doing it for me. But I guess I expected too
much! :)

-P
 
Back
Top