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

C#: The console is outputting infinite (∞)

I'm using Visual Studio 2015 on Windows 10, I'm still a new coder, I've just started to learn C#, and while I was in the process, I discovered the Math class and was just having fun with it, till the console outputted: " ∞ " It's a Console…
11
votes
3 answers

Problems debugging simple console program :: CLion

I am trying to learn basic C++ after being a Java developer. So I decided to give CLion a try. I wrote this basic code just to familiarize myself with some C++ syntax. #include using namespace std; int main() { string word; …
ryndshn
  • 692
  • 2
  • 13
  • 30
11
votes
3 answers

print all System.Environment information using System.Reflection

We have a little task to print in a console window all the variables of the Environment class using reflection, but how to do so I don't even have a clue. I am sorry if I've written anything wrong here, I'm new to C#. Of course I could use this kind…
11
votes
3 answers

Global variable in a static method

This seems basic but Im finding this quite trivial. Simply how would you recommend setting a global variable with a static class (i.e. console-application)? To give you a little more background the main method is calling some custom eventhandlers…
Leroy Jenkins
  • 2,680
  • 6
  • 25
  • 33
11
votes
3 answers

Console.Write() will hang in WPF, but works in Console application

Please read the answer by Scott Chamberlain to see why is it related to WINAPI. Create a new WPF application in Visual Studio and change the code in MainWindow.xaml.cs as below. Run the application. The code will hang on second call to…
Roman Byshko
  • 8,591
  • 7
  • 35
  • 57
11
votes
2 answers

How to call REST API from a console application?

How to call REST API from a console application? The response from my REST service will be XML format. In web I am calling like this string url = string.Format("{0}/name?PrimaryName={1}", ConfigurationManager.AppSettings["URLREST"],…
JIKKU
  • 577
  • 4
  • 9
  • 26
11
votes
5 answers

How to fix "No overload for method ' ' takes 0 arguments"?

How can I fix this error? "No overload for method 'output' takes 0 arguments". The error is at the very bottom at "fresh.output();". I don't know what I'm doing wrong. Can someone tell me what I should do to fix the code? Here is my code: using…
User
  • 159
  • 1
  • 3
  • 10
11
votes
5 answers

Change icon for a Delphi console application

How do I change the program icon for a Delphi console application? The application settings is greyed in a console application. Bye.
RRUZ
  • 134,889
  • 20
  • 356
  • 483
11
votes
3 answers

How to make a console application wait for the "Enter" key, but automatically continue after time?

I created a console application in delphi 7, which is supposed to show messages after you press the enter button: begin writeln ('Press ENTER to continue'); readln; writeln ('blablabla'); writeln ('blablabla'); end; The thing is that the…
user2276109
  • 143
  • 1
  • 3
  • 7
11
votes
3 answers

Unable to read data from the transport connection: The connection was closed error in console application

I have this code in console application and it runs in a loop try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(search); request.Headers.Add("Accept-Language", "de-DE"); request.Method = "GET"; request.Accept…
Darshana
  • 2,462
  • 6
  • 28
  • 54
10
votes
3 answers

Python Interactive Shell Type Application

I want to create an interactive shell type application. For example: > ./app.py Enter a command to do something. eg `create name price`. For to get help, enter "help" (without quotes) > create item1 10 Created "item1", cost $10 > del…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
10
votes
4 answers

Using Readline() and ReadKey() Simultaneously

Is there any way to detect both Readline and ReadKey, so that in most cases it behaves as a readline, except for some special key inputs that should be detected? I need some "parallel" implementation to introduce simultaneity. The code below is…
Mehdi LAMRANI
  • 11,289
  • 14
  • 88
  • 130
10
votes
2 answers

print variable name in a #define

I am trying to print out to console using a macro the variable name for display members value while debugging ( logging ). How to do that? I tried the following but it doesnt' work. #define MY_PRINT(x) std::cout << "'x'=" << x << std::endl; int…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
10
votes
3 answers

Impersonate with username and password?

WindowsIdentity identity = new WindowsIdentity(accessToken); WindowsImpersonationContext context = identity.Impersonate(); ... context.Undo(); Where do i declare a administraotr UserName and Passowrd ? the accessToken param doesn't help me too…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
10
votes
7 answers

How can I detect if "Press any key to continue . . ." will be displayed?

When running a console application in Visual Studio, depending on your settings, it will add a prompt after the program exits: Press any key to continue . . . I have found how to detect if I am running under the debugger(use Debugger.IsAttached),…