winapi - C# .NET Process class: How do I send input to a console process that is waiting for input? -


here's situation: our c# wpf application needs parse output 3rd-party console application writes file. starting process , parsing file after waitforexit() easy enough, unfortunately app written such after 20 lines of output, stops output , waits user hit return. yes, though writes output file, still pause , wait user hit return before writing next 20 lines. 3rd-party app closed source , there's no hope of recompiling disable behavior. it's quirky in respect, too: despite being console app, must run within it's own directory. given it's win32 port of old dos app, guess shouldn't surprised.

i'm aware of usual solutions waitforinputidle() or hacky win32 stuff, can't find suits situation. involves finding open window , sending input via win32 isn't option since console app can't run in window.

so think? have not found right win32 hack yet? maybe should wrap console app in winform , can use waitforinputidle()?

if it's normal console app, set useshellexecute false , redirectstandardinput true, use standardinput property write newline when needed.

using files extremely outdated approach, @ least 20 years past. whenever find using them, should consider modern standard input/output piping.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -