console-application

Creating standalone, console (shell) for domain-specific operations

Say that I have a system service, and I want to offer a low-level maintenance access to it. For that purpose, I'd like to create a standalone, console application that somehow connects to server process and lets user type in commands, allow it to use auto-completion and auto-suggestion on single/double TAB press (just like linux bash sh...

C# Console Application: Preventing Control-C from being printed?

Hi. I have a console app, and I want to capture Control-C and shutdown gracefully. I have the following code: Console.CancelKeyPress += new ConsoleCancelEventHandler((o, e) => { Logger.Log("Control+C hit. Shutting down."); resetEvent.Set(); }); And the output windows shows: 6/16/2010 3:24:34 PM: Control+C hit. Shutting dow...

Qt Console Application Tutorial?

Are there any Qt Console Application example/tutorial? I am looking for one that utilize the event loop. Most of the examples I have seen does not use the loop. ...

C++ or Python (maybe else) to create GUI for console application in C

I have a Visual C console application (created in VC++2008EE) and I need to add GUI to it. One idea was to invoke the console app as a subprocess and communicate with it using stdin and stdout. I tried to do that with Python subprocess module - but it deadlocks (probably because my console app is running continuously). As I understood f...

Unwanted buffering when filtering console output in Win32

My question is related to "Turn off buffering in pipe" albeit concerning Windows rather than Unix. I'm writing a Make clone and to stop parallel processes from thrashing each others' console output I've redirected the output to pipes (as described in here) on which I can do any filtering I want. Unfortunately long-running processes now ...

Increasing the size of console output display

Can we change/increase the size of console output to view large size of data in console application at once? ...

C# How to redirect stream to the console Out?

I found lots of samples how to redirect console output into a file. However I need an opposite soluiton - I have StreamWriter which I want to be shown in the Console output once I do sw.WriteLine("text"); ...

.NET Global exception handler in console application

Question: I want to define a global exception handler for unhandled exceptions in my console application. In asp.net, one can define one in global.asax, and in windows applications /services, on can define as below AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += new UnhandledExceptionEventHandler(M...

Quickest Way to Copy SQL Data

I could use some suggestions / ideas. I wrote a console application that queries all data from a table in MS Access (I know, but I inherited it) to a SQL table. It runs every morning as a scheduled task. The fields between the two tables are not identical. Currently I select all data from the MS Access table, loop through the dataset and...

Calling Java from a Java console app and an ASP.NET app

Hi, Recently I got asked to write a java application for my company. I'm a seasoned .Net developer so this is all new ground to me. My task is to produce an invoicing application that has several high level tasks such as: Build single invoice Build all invoices My company want to be able to call these tasks from a java console appli...

C# - Console Keystrokes

I want to compare the key pressed in a console to the left arrow key if they are equal meaning the key pressed was the left arrow key, key change the background color of the console to cyan... I'm not sure how to set up the If statement though, because I dont know how to compare keys in a console. using System; namespace ConsolePaint ...

Make a 'press any key' routine that is compatible with redirected standard input

I've got a C/C++ program that runs in a console window, and prompts the user to press any key to continue, or 'q' to quit. It currently uses _kbhit() to detect if a key has been pressed, and then uses _getch() to determine what character it was. Now I want to be able to automate this program (from a C# app using a Process with RedirectS...

C++ writing/reading hex values correctly (CryptoPP)

Hello, I am trying to run a program, that encrypts and decrypts using AES. (from http://www.codeproject.com/KB/security/AESProductKey.aspx ) // From aestest1.cpp // Runtime Includes #include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <string> #include "stdafx.h" // Crypto++ Includes #include "cryptlib...

Simplest way to get an interactive console for my app

I want a simple, interactive way to demo middle-tier features of my app which have not had a UI created yet. I want an interactive console. When my application (WPF but it shouldn't matter) boots up I would like to also start a console window. This window should run powershell (or ruby, or python, but preferably powershell) and have i...

How to find highest ,second highest number, Lowest Second Lowest number in given Array

Hello guys, Can anyone Please tell me how to How to find highest ,second highest number, Lowest Second Lowest number in given Array var numbers = new[] {855,3,64,6,24,75,3,6,24,45}; Any pointer and suggestion would really helpful . Thanks ...

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 doesn't the compile-time test work? As far as I can understand from this doc, it sure shoul...

jpa without container

Hi, I like to use jpa, but without application container. I intend it to use it in console application. Is there any example ? Regards ...

Set focus on console in Windows?

Is it possible to set focus on a console app in Windows? SetFocus looks promising, but it needs an HWND and I don't know if console apps even have one. ...

TaskKill for killing .NET console application

I have a bunch of console host applications hosting WCF services. I'm calling a .bat file as a pre build step to kill any running host instances so that I don't get WCF channel registrations errors(manually killing the console hosts each time before a build is a royal pain). The .bat file I've created contains the following. taskkill /...

Using an OCX control in a C# .NET console application

As the title points out, what I want to do is use an .OCX control (namely AxShockwaveFlashObject) in a C# console application. I assume that it's possible, as I've seen it done before. but it was C++, and I don't even sure it was .NET. So, is it possible? and if so, how? Thanks, Leeron ...