Im trying to redirect console output from the arma dedicated into a windows form application written in C#. I'm having a hell of a time with it and cant seem to quite get it right.
This is what I have so far. It just hangs the program though when it's called though.
Oh dear. Should of explained that. I'm making a dedicated server UI. Kinda my intro to C# project. I've got most of it done besides this little roadblock
Not sure off the top of my head, but doesn't ReadToEnd imply that it will load all output up until the process terminates? I think you want something that reads only until a new line character. This'll need to be in some sort of loop, e.g.:
Tank Program wrote:Not sure off the top of my head, but doesn't ReadToEnd imply that it will load all output up until the process terminates? I think you want something that reads only until a new line character. This'll need to be in some sort of loop, e.g.:
While (Tron is Running) {
Read a line from the console
Process based on that line
}
Is there a BufferedStreamReader? That would be the right direction to look in I think.
That would explain why it hangs when the program starts and continues when I manually end the process. Thanks for that. I'll look into what you've said and communicate my findings :3.