Screen scrambles command window using .net managed code

I am writing a program in dot net that will execute scripts and command line programs using a Framework 2.0 Process object. I want to have access to the process screen buffers in my program. I researched this, and it seems to me that I need to access console stdout and stderr buffers. Does anyone know how this is achieved using managed code?

I think I need to use the AttachConsole and ReadConsoleOutput of the Windows console attached to the task in order to read the block of characters and attribute data from the console screen. I need to do this managed code.

See http://msdn.microsoft.com/en-us/library/ms684965(VS.85).aspx

+3
source share
1

, StandardError, StandardOutput StandardInput System.Diagnostics.Process.

MSDN .

, . , , stdout .

, ProcessStartInfo.UseShellExecute false, ProcessStartInfo.RedirectStandardInput true. StandardInput .

+2

Source: https://habr.com/ru/post/1697017/


All Articles