Click here to Skip to main content
15,890,399 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my project I am using 2 modules. One for encoder and other one for decoder.
The encoder will convert the word file into binary form and decoder will decode back to original one.
This is the concept.

I am using Visual Studio 2010 and WPF application.
Posted
Updated 6-Oct-11 1:27am
v3
Comments
André Kraak 6-Oct-11 2:19am    
Repost of: http://www.codeproject.com/Questions/264237/Converting-Word-document-to-binary-format-and-vice.aspx

Creating a new account and posting the same question again will not help get it answered any quicker.
It may even work against you as people do not like this pushy behaviour.
Look at your original question and see if you can make it any clearer and respond to any inquiries made; this should make the question more appealing.

Please remove this repost. Thank you.
Peter_in_2780 6-Oct-11 3:07am    
Hey, don't be too hard on him. It might just be that a classmate beat him to the question! ;)
André Kraak 6-Oct-11 3:12am    
That might me true, must be a hassle in the classroom though them both having the same name "Asok Kumar".

To read a file in bytes use the following code :
C#
byte[] bytes = File.ReadAllBytes("filename.ext");


Now you can do what ever you want to the array of bytes.
 
Share this answer
 
Hi,
In order to read the bytes you can use FileStream class.
C#
FileStream stream = new FileStream("pathtodoc.ext", FileMode.Open);
byte [] array = new byte[stream.Length];
int bytesread = stream.Read(array, 0, stream.Length);

In order to write back the bytes into stream use Write method.
C#
FileStream stream = new FileStream("pathtodoc.ext", FileMode.Create);
stream.Write(array, 0, stream.Length);

Regards
 
Share this answer
 

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

  Print Answers RSS


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