Recimo ovaj kod upiše 100 različitih naredbi i dobije 100 različitih odgovora, ne zablokira nikad ( P.S. ispiše do 90 jer prvih 10 probadne na intro ( Crafty poruke kad se inicijalizira). Pošalji mi točne naredbe, da probam sa njima.
Code:
class Program
{
static void Main ( string [] args )
{
Process p = new Process ();
string s;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "Crafty.exe";
p.Start ();
StreamReader reader = p.StandardOutput;
StreamWriter writer = p.StandardInput;
writer.AutoFlush = true;
int a = 0;
while ( a < 100 )
{
writer.WriteLine ( a );
s = reader.ReadLine ();
Console.WriteLine ( s );
a++;
}
}
}