Hi,
I am trying to serialize n number of objects in a file in Binary
Formatter’s method.
I simplify my problem here.
I am trying to serialize 4 lines (string) into a file. While
deserialize, I am able to retrieve the first data only.(in case of
string 1st serialized string only)
The code is as below.
object content;
MemoryStream ms = new MemoryStream(File.ReadAllBytes(@"d:\test
\test.txt"));
BinaryFormatter bf = new BinaryFormatter();
content = bf.Deserialize(ms);
ms.Close();
return content;
fyi,
I tried with FileStream, static File methods(return stream). When I
tried to get size of stream, it is giving approximately equal to
content length if the object is string (So the stream is getting full
data). Am I going in right direction??? Is it the conversion problem?
Or am i missing something.
Pls help me to solve the problem?
Thanks & Regards,
Velsankar