471,873 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

Reading end of file stream in C# problem

Hey all,

I'm trying to make my app read the stream of a text file and begin at the end of the file. Then parse all the lines that get added in the text file by a other app (Its a log file from a game) and display it in a multiple editbox or richeditbox.

Ive tryed somthing like this

private FileStream file;
private StreamReader stream;

public void logInstance()
file = new FileStream("f:\\everquest\\logs\\eqlog_Machia_xego ny.txt",
FileMode.Open, FileAccess.Read);

stream = new StreamReader(file);
stream.BaseStream.Seek(0, SeekOrigin.End);

// This is a timer and schould display all new added lines of text to the richeditbox

public void timer_Tick(object sender, EventArgs e)
string logString = stream.ReadLine();

if (logString != null)
richTextBox.Text += logString + " \n";

Anyone has a idee how to do this? the above code will display nothing, if i change the seek to begin it will parse the text file trough.
Sep 10 '06 #1
0 6748

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by nightflyer | last post: by
8 posts views Thread by Phil Slater | last post: by
7 posts views Thread by Shane | last post: by
2 posts views Thread by Mad Scientist Jr | last post: by
8 posts views Thread by T Driver | last post: by
9 posts views Thread by Eric Lilja | last post: by
3 posts views Thread by rsk | last post: by
6 posts views Thread by efrenba | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.