ha0-sama
ha0-sama
CC#
Created by ha0-sama on 3/9/2023 in #help
❔ What to do if my program says "stream 0x5848 ended with code 0" when program isn't over yet
I have a program with a very long lead time, and after a couple of minutes it stops working and shows me this. Maybe its because i am using debug mode?
3 replies
CC#
Created by ha0-sama on 3/7/2023 in #help
✅ How read text output from already started process?
I need to read data from my chess engine and below is my code
var proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "stockfish-windows-2022-x86-64-avx2.exe",
UseShellExecute = false,
RedirectStandardOutput = true,
}
};
while(true) //i know thats bad
{
StreamReader reader = proc.StandardOutput;
string line = reader.ReadLine();
Debug.WriteLine(line);
}
var proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "stockfish-windows-2022-x86-64-avx2.exe",
UseShellExecute = false,
RedirectStandardOutput = true,
}
};
while(true) //i know thats bad
{
StreamReader reader = proc.StandardOutput;
string line = reader.ReadLine();
Debug.WriteLine(line);
}
But after starting that, I am getting
System.InvalidOperationException: "StandardOut has not been redirected or the process hasn't started yet."
System.InvalidOperationException: "StandardOut has not been redirected or the process hasn't started yet."
How I can fix that? Please...
13 replies