lanac222
asked on
convert bin file to text file in c#
Hi,
I need to convert a bin file to txt file in C#. Please show me some example code.
Thanks
Lanac
I need to convert a bin file to txt file in C#. Please show me some example code.
Thanks
Lanac
Using sample code listed on the following page, you can try opening and manipulating both types of files (binary/text) in both modes:
http://www.ondotnet.com/pub/a/dotnet/2002/08/05/io.html?page=5
_______________
Nayer Naguib
http://www.ondotnet.com/pub/a/dotnet/2002/08/05/io.html?page=5
_______________
Nayer Naguib
ASKER
but i'd like to convert the binary data to man readable text.
Usually, binary files do not contain readable text. Try opening some MP3 or AVI file using Notepad and take a look at its contents!
If you are sure that some file contains readable text (even if the extension is not "TXT"), you can simply open the file in text mode. Otherwise, you will not be interested in reading binary data in text mode.
_______________
Nayer Naguib
If you are sure that some file contains readable text (even if the extension is not "TXT"), you can simply open the file in text mode. Otherwise, you will not be interested in reading binary data in text mode.
_______________
Nayer Naguib
ASKER
The file contents are numeric data generated at a POS. It should be readable text. But when I open with notepad it still shows binary code.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
_______________
Nayer Naguib