Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to read the data from a .DAT File.
below is the structure of how the data is arranged inside the DAT File.

Winword.exe-|-Excel.exe-|-MS PAINT.exe-|-

-|- is used to make separation between the two data entry!!

Can anybody help me on how to read the from this .DAT file using C# programing!!!

Thanks in Advance

Best Regards
Balkrishna Raut
Posted
Updated 2-Aug-17 0:09am
Comments
shubhangi waghmare 17-Aug-13 4:46am    
I want to read audio file or recording file in character format in c#.net
Please help me anyone...

1 solution

This is the example of reading serialized custom object reding from .DAT file

C#
ObjectToSerialize objectToSerialize;
      Stream stream = File.Open(filename, FileMode.Open);
      BinaryFormatter bFormatter = new BinaryFormatter();
      objectToSerialize = (ObjectToSerialize)bFormatter.Deserialize(stream);
      stream.Close();
      return objectToSerialize;


You could use 'String' Instead of 'ObjectToSerialize' ( because your .DAT contains string rather then custom object)

Please vote and Accept Answer if it Helped.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900