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

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
 
G

Guest

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
 
P

pamela fluente

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top