Question : C# Deserialize from a text file.

I have a small application that takes software Ids from the user and writes them to a text file.  I am using a BinaryFormatter with a file stream and a serialized software class to write the file.  One file can hold multiple software objects.  That part works fine, however, when I try to open the file an deserialize the objects I am not sue how to iterate through the complete file.  I can easily get the first object from the file, but the remaining.  

thank you for any help.  

Answer : C# Deserialize from a text file.

How are you explicity separating the ID's in the file? newlines? any other character?
If you are writing the IDs with writeline, then you may recover them with a loop while(ID=filex.readline())
if you are using any other separator then you may read the whole file into a string and do a datareaded.split('x') where x is the separating character.
Or you can read byte after byte and comparing it against the separator to identify when a new ID is about to start.
Random Solutions  
 
programming4us programming4us