Is There the EOF in C#?

  • Thread starter Thread starter ±èÀçȲ
  • Start date Start date
±

±èÀçȲ

Is There the EOF in C#.?

What is the EOF..?

Why C# doen't have EOF ..?

Thanks..Enjoy Programming!!
 
It depends EOF of what?

a textfile has a EOF, so does an xmlreader etc.

You might want to type .EOF behind the object you want to check for EOF

Greetz

--
Tom Vergote / Developer
ORBID / IT Services
Tramstraat 61 / B-9052 GENT
Tel +32 (0)9 244 99 45 / +32 (0)9 244 99 96
http://www.orbid.be
 
±èÀçȲ said:
Is There the EOF in C#.?

What is the EOF..?

Why C# doen't have EOF ..?

Thanks..Enjoy Programming!!

How about:

using (StreamReader sr = new StreamReader("TestFile.txt"))
{
String line;
while ((line = sr.ReadLine()) != null)
{
Console.WriteLine(line);
}
}
 
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.

Hope this helps
--- Nick
 
Back
Top