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
12
votes
2 answers

Getting WebBrowser Control To Work In Console Application?

I have a printer class that is capable of printing HTML via the WebBrowser object. I want to be able to print from a console application, but I get an error when my printer class tries to create a WebBrowser object: WebBrowser browser = new…
sooprise
  • 22,657
  • 67
  • 188
  • 276
12
votes
4 answers

What is the nicest way to close FreeGLUT?

I'm really having trouble closing my console application with FreeGLUT. I would like to know what the best way is to take every possible closing, because I don't want any memory leaks (I'm pretty afraid of those). So I already tried the following,…
Marnix
  • 6,384
  • 4
  • 43
  • 78
12
votes
3 answers

Error-Attempt by method 'X.set_DbConnection(System.Data.Common.DbConnection)' to access method 'Y.get_Settings()' failed

I created a console app and use EntityFramework 6.2 (for connection with MS SQL), MySql.Data 8.0.11 and MySql.Data.Entity 6.10.7 (for connection with MySQL). In this application I want to create a job like an SQL job but I don't want to use…
Oyama
  • 123
  • 1
  • 6
12
votes
2 answers

How to use Dependency Injection in .Net core Console Application

I have to add data to my database using a Console Application. In the Main() method I added: var services = new ServiceCollection(); var serviceProvider = services.BuildServiceProvider(); var connection = @"Server = (localdb)\mssqllocaldb; Database…
Uladz Kha
  • 2,154
  • 4
  • 40
  • 61
12
votes
3 answers

c# console, Console.Clear problem

I am writing a console program in C#. Is there a way I can use a Console.Clear() to only clear certain things on the console screen? Here's my issue: I have a logo (I put it on screen using Console.WriteLine()) and a 2d array which I want to keep…
user47415
  • 123
  • 1
  • 5
12
votes
4 answers

Making UI for console application

How can I make an interface for console applications to make them look like edit.com under Microsoft's operating systems. Target languages are C, C++ and C#.NET.
David Weng
  • 4,165
  • 12
  • 42
  • 51
12
votes
2 answers

smtp exception “failure sending mail”

I created console application for sending Email public static void sendEmail(string email, string body) { if (String.IsNullOrEmpty(email)) return; try { MailMessage mail = new MailMessage(); …
user5264652
12
votes
5 answers

Delphi {$IFDEF CONSOLE} Problem

I just tried program Project1; {$APPTYPE CONSOLE} uses SysUtils; begin {$IFDEF CONSOLE} beep; {$ENDIF} end. and expected to hear a beep during runtime, but not. The following test works, though: if IsConsole then beep; Why…
12
votes
3 answers

cscript - print output on same line on console?

If I have a cscript that outputs lines to the screen, how do I avoid the "line feed" after each print? Example: for a = 1 to 10 WScript.Print "." REM (do something) next The expected output should be: .......... Not: . . . . . . . . . . In…
Guy
  • 9,720
  • 7
  • 38
  • 42
12
votes
4 answers

IOC for a Console Application?

Can anyone think of a good solution for getting IOC into a console application? At the moment we are just using a static class with the following method: public static T Resolve() { return dependencyResolver.Resolve(); } I would like the…
dagda1
  • 26,856
  • 59
  • 237
  • 450
12
votes
3 answers

Getting the exit code of an application started with the "cmd" and "start" commands

I have a console application. Interaction with this application is done via TCP/IP. I also have a test framework for it, which is basically a collection of BATCH scripts (...not my fault). What this test framework does for each test is basically…
12
votes
2 answers

System.IO.IOException when calling System.Console.WindowWidth

When making calls to any one of System.Console.BufferWidth, System.Console.CurserLeft or System.Console.WindowWidth I am greeted with a System.IO.IOException when executing my [console] app from within PsExec. All works correctly when executed…
SmithPlatts
  • 773
  • 7
  • 20
12
votes
6 answers

How do you keep the console from closing after the program is done in C?

Possible Duplicate: What is the Best Practice for Combating the Console Closing Issue? How do you keep the console from closing after the program is done in C? When I try to search for it I find lots of stuff about C++ and other languages, but…
Adam
  • 2,606
  • 4
  • 19
  • 14
12
votes
4 answers

What is the Purpose of Console.WriteLine() in Winforms

I once saw the source code of a winform application and the code had a Console.WriteLine();. I asked the reason for that and i was told that it was for debugging purposes. Pls what is the essence of Console.WriteLine(); in a winform and what action…
user2509901
12
votes
3 answers

How to call event before Environment.Exit()?

I have a console application in C#. If something goes wrong, I call Environment.Exit() to close my application. I need to disconnect from the server and close some files before the application ends. In Java, I can implement a shutdown hook and…
Makah
  • 4,435
  • 3
  • 47
  • 68