Questions tagged [console-application]

A console application is a computer program designed to be used via a text-only computer interface, such as a text terminal, the command line interface of some operating systems (Unix, DOS, etc.) or the text-based interface included with most Graphical User Interface (GUI) operating systems, such as the Win32 console in Microsoft Windows, the Terminal in Mac OS X, and xterm in Unix.

A console application is a computer program designed to be used via a text-only computer interface, such as a text terminal, the command line interface of some operating systems (Unix, DOS, etc.) or the text-based interface included with most Graphical User Interface (GUI) operating systems, such as the Win32 console in Microsoft Windows, the Terminal in Mac OS X, and xterm in Unix. A user typically interacts with a console application using only a keyboard and display screen, as opposed to GUI applications, which normally require the use of a mouse or other pointing device. Many console applications such as command line interpreters are command line tools, but numerous text-based user interface (TUI) programs also exist.

As the speed and ease-of-use of GUI applications have improved over time, the use of console applications has greatly diminished, but not disappeared. Some users simply prefer console based applications, while some organizations still rely on existing console applications to handle key data processing tasks.

7241 questions
42
votes
8 answers

Compile to a stand-alone executable (.exe) in Visual Studio

how can I make a stand-alone exe in Visual Studio. Its just a simple Console application that I think users would not like to install a tiny Console application. I compiled a simple cpp file using the visual studio command prompt. Will the exe work…
Mohit Deshpande
  • 53,877
  • 76
  • 193
  • 251
41
votes
4 answers

Show message Box in .net console application

How to show a message box in a .net c# or vb console application ? Something like: Console.WriteLine("Hello World"); MessageBox.Show("Hello World"); or Console.WriteLine("Hello") MsgBox("Hello") in c# and vb respectively. Is it possible?
Syed Osama Maruf
  • 1,895
  • 2
  • 20
  • 37
41
votes
1 answer

How to get column names with query data in sqlite3?

I use sqlite3 console to debug my app while it is executing in Android. Is there a way to show also column names (not only data) with data in result of sql query?
Prizoff
  • 4,486
  • 4
  • 41
  • 69
40
votes
4 answers

Global hotkey in console application

Does anyone know how to use the RegisterHotKey/UnregisterHotKey API calls in a console application? I assume that setting up/removing the hotkey is the same, but how do I get the call back when the key was pressed? Every example I see is for…
user60456
40
votes
6 answers

Run console application from other console app

I have a C# console application (A). I want to execute other console app (B) from within app A (in synchronous manner) in such way that B uses the same command window. When B exists, A should be able to read B's exit code. How to do that? I need…
Dawid Ohia
  • 16,129
  • 24
  • 81
  • 95
40
votes
6 answers

Is Thread.Sleep(Timeout.Infinite); more efficient than while(true){}?

I have a console application that I would like to keep open all of the time while still listening in to events. I have tested Thread.Sleep(Timeout.Infinite); and while (true) { } and both allow the events to be raised while keeping the console…
Lunyx
  • 3,164
  • 6
  • 30
  • 46
39
votes
7 answers

Custom text color in C# console application?

I just finished my C# console application code for a project and would like to add some color to my font. I would love to be able to use a custom color - orange. Is there any way to do this? This is the code I have been using to change colors in the…
Thomas
  • 457
  • 2
  • 7
  • 12
39
votes
2 answers

Non-Blocking read from standard I/O in C#

I want a non-blocking read function from console. How do I write that in C#?
Masoud
  • 1,354
  • 6
  • 18
  • 30
39
votes
5 answers

Can I get copy/paste functionality from a C# Console Window?

I am developing a console application in C#, and was wondering if there was a way to get the "copy-paste" or "mark-paste" functionality into my application, similar or identical to that of the standard Windows command prompt. Is this a wild goose…
Simpleton
  • 1,201
  • 3
  • 13
  • 16
38
votes
2 answers

.Net 6 Console app: WebApplication.CreateBuilder vs Host.CreateDefaultBuilder

I'm looking into .NET 6, and wanted to build a simple console application, with some dependency injection. From what i can read, a lot has been done to make the startup (now just program) file, more readable. What does confuse me a bit is, that all…
KristianMedK
  • 1,659
  • 6
  • 24
  • 52
38
votes
1 answer

Windows Console Application Getting Stuck (Needs Key Press)

I have a console program that has different components that run like this: void start() { while(true){ DoSomething(); Thread.Sleep(1000*5); } } My main entry point looks like [pseudo-ish…
Luke Belbina
  • 5,708
  • 12
  • 52
  • 75
37
votes
2 answers

The "correct" way to create a .NET Core console app without background services

I'm building a simple .NET Core console application that will read in basic options from the command line, then execute and terminate without user interaction. I'd like to take advantage of DI, so that lead me to using the .NET Core generic…
Alan Shearer
  • 563
  • 1
  • 4
  • 7
37
votes
1 answer

How can I add Version info to my Console Applications?

It appears to be what console application projects generated by IDE's intrinsic wizard cannot have version resource managed by IDE <- note the emphasis here. Is there any workaround(s) for this issue? (i even ready to write an OTA wizard)
Premature Optimization
  • 1,917
  • 1
  • 15
  • 24
37
votes
2 answers

Why does Console.Out.WriteLine exist?

Actually the question should be why does Console.WriteLine exist just to be a wrapper for Console.Out.WriteLine I found this little method using intellisense, then opened .NET reflector and 'decompiled' the code for the Console.WriteLine method and…
Kredns
  • 36,461
  • 52
  • 152
  • 203
36
votes
6 answers

How to programmatic disable C# Console Application's Quick Edit mode?

I've tried several solutions found, like the one -> http://www.pcreview.co.uk/forums/console-writeline-hangs-if-user-click-into-console-window-t1412701.html But, I observed that mode in GetConsoleMode(IntPtr hConsoleHandle, out int mode) will be…
Himanshu
  • 507
  • 1
  • 6
  • 10