Are you expecting a character encoded in the file that indicates the end of
file?
This is not a C# thing.
The file system does not encode a character to indicate the end of file
(although Ctrl-Z will still be treated as EOF by older C programs when
reading in character mode). The file system keeps track of the length of a
file, and when you've read all the characters, or bytes, in the file (as the
case may be), you are at the end. It's pretty simple.
EOF is a condition that can be detected using the properties on the stream
that you are using to read or write a file. It is not a character.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.