Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting and Communicating with console apps from a GUI

Tags:

c#

I want to make a GUI for chess in C#. The modern freely available engines use the UCI interface, which runs as a standalone console application and communicates through text commands and outputs.

How can I run console programs (these chess engines) in background transparently to the user of my GUI, and communicate with them?

like image 537
KalEl Avatar asked May 12 '10 17:05

KalEl


People also ask

How do I open the application console?

Step 1: To open the console in Chrome, use this keyboard shortcut: "Cmd + Option + J" (on a Mac) or "Ctrl +Shift +J" (on Windows). As an alternative, you can right-click on the webpage and click "Inspect" to open the developer console.

How can I open console application without Windows?

If you do not know what I am talking about: press Win+R, type “help” and press ENTER. A black console window will open, execute the HELP command and close again. Often, this is not desired. Instead, the command should execute without any visible window.

What are a console application and an example?

An application that uses the command line for input and output rather than a graphical interface (GUI). For example, utility programs that perform a single function or that run in the background are often written as console apps.


1 Answers

Just start the console process using ProcessStartInfo.RedirectStandardInput and RedirectStandardOutput, and read and write to the input/output as needed.

Here is an article describing the full process.

like image 82
Reed Copsey Avatar answered Nov 14 '22 22:11

Reed Copsey