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
17
votes
1 answer

Why is AsyncContext needed when using async/await with a console application?

I'm calling an async method within my console application. I don't want the app to quit shortly after it starts, i.e. before the awaitable tasks complete. It seems like I can do this: internal static void Main(string[] args) { try { …
rory.ap
  • 34,009
  • 10
  • 83
  • 174
17
votes
2 answers

How do I start a second console application in Visual Studio when one is already running

I am working through some examples in a WCF book. There is a Host project and Client project within a single solution. Both are console applications. The Host is the startup app, but the Client app doesn't seem to open the Console like the book…
Hcabnettek
  • 12,678
  • 38
  • 124
  • 190
17
votes
2 answers

C# Unit Testing(Nunit) the Main method of a console app?

I have a question on unit testing the Main method of a console app. The standard signature is public static void Main(string[] args) I want to be able to test to ensure that only 1 parameter is passed in. If more than one parameter is passed in…
Martin
  • 23,844
  • 55
  • 201
  • 327
17
votes
6 answers

VB.Net 'Sub Main' was not found

ok, I have an A level computing exam on Monday, and I have been working on the pre-release skeleton code. This morning when I tried I got an error saying 'Sub Main' was not found. There clearly is a Sub Main() in the code which I will paste in…
Ed Prince
  • 714
  • 2
  • 14
  • 31
17
votes
1 answer

Multiple objects drawing (OpenGL)

The issue is that I can't figure out how to properly draw two objects, because my another object isn't being drawn. Here's the main code: GLuint VertexArrayID; glGenVertexArrays(1, &VertexArrayID); glBindVertexArray(VertexArrayID); GLuint…
RevanReborn
  • 185
  • 1
  • 1
  • 6
16
votes
4 answers

Why the default SynchronizationContext is not captured in a Console App?

I'm trying to learn more about the SynchronizationContext, so I made this simple console application: private static void Main() { var sc = new SynchronizationContext(); SynchronizationContext.SetSynchronizationContext(sc); …
16
votes
2 answers

Accessing dbContext in a C# console application

I have tried to figure this out, but I am stuck. I have a Net Core 2 application with Service/Repo/Api/Angular layers - but now I want to 'bolt on' a console application and access all the goodies I have already built up. I seem to be in a mess of…
spankymac
  • 746
  • 2
  • 7
  • 14
16
votes
2 answers

Delphi Console Application increase input character limit

Is it possible to increase the number of characters that the console app accepts for readln. It seems to only allow you to type 254 characters To Reproduce in Delphi File > New > Other > Console Application change the code to be as per below program…
Dangas56
  • 849
  • 1
  • 8
  • 32
16
votes
2 answers

standard way to perform a clean shutdown with Boost.Asio

I'm writing a cross-platform server program in C++ using Boost.Asio. Following the HTTP Server example on this page, I'd like to handle a user termination request without using implementation-specific APIs. I've initially attempted to use the…
Timothy003
  • 2,348
  • 5
  • 28
  • 33
16
votes
2 answers

Embed a Console Window inside a WPF Window

Is it possible to embed a console window inside a WPF window? As a little background, at first, I tried to implement a console window from scratch in WPF, which was successful except for one huge problem -- it is extremely slow. See the question…
InfinitiesLoop
  • 14,349
  • 3
  • 31
  • 34
16
votes
9 answers

how to execute console application from windows form?

I want to run a console application (eg app.exe) from a windows form load event. I'v tried System.Diagnostics.Process.Start(), But after it opens app.exe, it closes it immidiately. Is there any way that I can run app.exe and leave it open?
Or Betzalel
  • 2,427
  • 11
  • 47
  • 70
16
votes
6 answers

CodeGolf: Brothers

I just finished participating in the 2009 ACM ICPC Programming Conest in the Latinamerican Finals. These questions were for Brazil, Bolivia, Chile, etc. My team and I could only finish two questions out of the eleven (not bad I think for the first…
Sergio Tapia
  • 40,006
  • 76
  • 183
  • 254
16
votes
3 answers

How to change directories on console application

I am creating a simple explorer program for an assignment on c# and have the directory set to c:\\Windows How you would be able to change the directory from the default windows to something else in the console.
Anthony Bond
  • 161
  • 1
  • 1
  • 3
16
votes
3 answers

Redirect console to Visual Studio debug output window in app.config

I want to get my Console.WriteLine() commands to appear in my "Output" window with my Debug.WriteLine() statements. I think I figured out how to do this once, but I can't remember / find on google how to do it again. I seem to remember being able to…
Quinn Wilson
  • 7,995
  • 1
  • 22
  • 31
16
votes
10 answers

Wrap text to the next line when it exceeds a certain length?

I need to write different paragraphs of text within a certain area. For instance, I have drawn a box to the console that looks like this: /----------------------\ | | | | | | | …
rshea0
  • 11,769
  • 9
  • 27
  • 40