0
How to convert a text file to binary then back.
I've been around a few dozen sites trying code samples and trying different search terms. I've a .txt file I'm trying to convert to binary using C#. Is there a quick method I can use? Or am I stuck providing an exact item for item change directory in another text file? I also, obviously, would need to be able to return the text file back to normal. I'm a beginner so doing massive edits are bad and I know asking others to do the work for me is a nonstarter. I'm looking for a tutorial, a guide, or something I can use to learn from mostly. Many thanks in advance.
2 RĂ©ponses
+ 2
Since your computer stores everything in binary you fortunately don't need to convert:
File.ReadAllBytes("file.txt")
gets you an array of bytes (`byte[]`), all binary, no text!