Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Apparently you are running a third-party console application from your own, then you need to redirect the standard output of this application and look for the desired word there:
var proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "program.exe",
Arguments = "command line arguments to your executable",
// Перенаправдяем поток вывода
RedirectStandardOutput = true
}
};
proc.Start();
// Читаем поступающие к поток данные
while (!proc.StandardOutput.EndOfStream)
{
string line = proc.StandardOutput.ReadLine();
if( line.IndexOf("Username", StringComparison.InvariantCultureIgnoreCase) )
{
// что-то там делаем
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question