Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a console user interface in .net possible? [closed]

I am wondering whether there are libraries in .NET that make it easy to write console user interfaces. For instance, imagine a WinForms application, where the user can:

  • Navigate the menus
  • Respond to dialogs

And the application in return displays several lines of text.

It can be shown, that the GUI in such an application can be mapped to the respective CUI without any problem.

So, if one has to stick to console, then are there any .NET tools to let write such CUI easily?

EDIT1

Let me define a constraint, which should help folks to grasp the idea of CUI. Imagine a machine, to which you can open a remote console, but not RDS. So, running a GUI application remotely on that machine is out of the question, because it will be unable to open any window. However, it is possible to have a remote console, leaving us with two possible flavors of CUI:

  • Character based graphics, like old supermarket terminals
  • Completely text based.

The first options allows to place characters at arbitrary positions on the console window. ncurses is the low level library for *nix systems that allows to do such things. A CUI created in such a way can be pretty expressive and convenient, but for the sake of our discussion let me rule this option out as well, because a remote console is unlikely to support the ability to move around the console window.

So, this leaves us with the text based CUI, the one created by means of printf and scanf only (and the likes).

EDIT2

Another clarification: I mention Windows Forms in the question as an example of simple User Interface, which has nothing special that could not be translated to text based console UI. This is only to illustrate that simple GUI elements like menus and modal dialogues can be modeled in console without resorting to windows.

like image 974
mark Avatar asked Feb 22 '11 14:02

mark


People also ask

How do I close the console in C#?

Exit() method to exit a console application in C#. The Environment. Exit() method is used to end the execution of a console application in C#.

Is console a user interface?

Console user interface may refer to: Command-line interface, user interface using only text. Text-based user interface, user interface with simple text-based menus and dialogues.

What is .NET console?

The console is an operating system window where users interact with the operating system or with a text-based console application by entering text input through the computer keyboard, and by reading text output from the computer terminal.

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.


1 Answers

Have a look at consolemenuui.codeplex.com. Other than menus (plus Yes-No dialogs and value prompts which should be easy to implement), I could hardly imagine other possible prompt-based controls.

like image 52
Maxim Gueivandov Avatar answered Nov 02 '22 22:11

Maxim Gueivandov