console-application

how can I write an ANSI C console screen buffer?

I'm working on making an ASCII based game, and everywhere I look people are saying to use Console.Write() from MSDN, which is dandy and all if you're using Windows, but I'm not. And thus, I'm trying to write a function, or group of functions in C that can alternate between two screen buffers, and write them to the screen, similar to wha...

What happens when you close a .NET console application?

Is a method such as OnClosed(EventArgs e) called? Update Ended up using code from the following url: http://osdir.com/ml/windows.devel.dotnet.clr/2003-11/msg00214.html ...

Extension methods + Console apps

Ok, i'm well and truly stumped here. I've written extension methods before, and never had any problems. However, i've never had to use them in Console Apps. The following code won't compile and I have no idea why! I created a simple console app to try it out and it just won't work: using System; using System.Collections.Generic; using ...

How do I return a value from a console application to a service in .NET?

I have a .NET service. I have a .NET console application. I want something along the lines of the service calling Process.Start("consoleapp.exe") and getting some information returned back from the app, ideally just returning a number. How do I do this? Edit: I figure it must be: Process.Start("myapp.exe").ExitCode - but how do I se...

Debugging console application in VS 2008 launches web servers?

I have a rather large solution in VS 2008. It contains 3 web applications and a console application as well as numerous class library projects. I've set the console application as the startup project, but when I debug (using F5) Visual Studio launches development web servers for all three of the web projects. My question is why, and c...

shared functionality between C# console apps

I have two console apps, Query and Update, that share some functionality. I wanted to have the two classes inherit from a common base class, but the problem is that, for a console app, I have to have a static Main function. What I currently have is the following: namespace Utils { public class ConsoleBase { protected c...

What are the Best Practices regarding error codes returned by a Console application?

In c# you can return an integer to the underlying caller using Environment.Exit(n) (which can be tested, for instance, using the ERRORLEVEL variable from a DOS script). Are there best practices regarding those codes? I think 0 = no error... but are there numbers reserved? Can I use negative numbers? etc Thanks! ...

ConfigurationErrorsException in a console app

The entry 'MyCustomElement' has already been added. C:\Projects\Sandbox\Sandbox.Console\bin\Debug\Sandbox.Console.vshost.exe.config line 52 I'm a bit stumped on this one. This console app has had quite a few custom config sections added over the past few weeks with no issue. We've run the app for some time and just recently(within the...

CodeGolf: Brothers

Hi guys, 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 try). Here's one we could finish. I'm curious to seeing any variations to the co...

Change icon for a Delphi console application

Hi, How do I change the program icon for a Delphi console application? The application settings is greyed in a console application. Bye. ...

C# Console App System.Drawing Background Transparency Question

Hi All, Should be a quick and easy question. Does System.Drawing.Graphics.DrawImage() or Image.Save() by default make an image background transparent? I had to use System.Drawing.Bitmap to adjust image resolutions and now all of the converted images have a transparent background. Futher details: We are using ImageMagick to do the bas...

How to set default input value in .Net Console App?

How can you set a default input value in a .net console app? Here is some make-believe code: Console.Write("Enter weekly cost: "); string input = Console.ReadLine("135"); // 135 is the default. The user can change or press enter to accept decimal weeklyCost = decimal.Parse(input); Of course, I don't expect it to be this simple. I am ...

Consume a WCF service from a console app as part of a SQL job?

I'm working with one WCF service which will be consuming records I queue up for it with another. Service A will package up an object containing a series of records (I guess an XML document, haven't nailed down the format yet) queried from a database, and submit it to Service B for processing. Service B is on a separate department's sys...

Getting output from one executable in an other one

Hi there. I'm currently trying to get the output of an executable console-app into an other one. To be exact, a little overview of what I'm trying to do: I have one executable which I cannot edit and neither see it's code. It writes some (quite a bunch to be honest) lines into the console when executed. Now I want to write another exe...

WindowLess WinForm or Console app to launch .bat files?

I want to launch a .bat file through a scheduler. The .bat file calls a third party command line tool. What's the difference between doing this through a console app vs a windowless winform application? I am using .NET. I prefer the app not show a DOS window. ...

QT exited with code 0 on release

Hello, Does anyone have stucked on strange problem with QT Creator. When I try to build my simple console app in it with release in output window i see only: Starting C:\Users\xxxxx\Documents\Composite\Compositing\debug\Compositing.exe... C:\Users\xxxx\Documents\Composite\Compositing\debug\Compositing.exe exited with code 0...

Write code for execution time on C# Command Line Application

I want to have my program execute a bunch of commands on load-time and this is in C# btw, but it's a console program, how can I do that? ...

NHibernate Session Management in Console App

I have core library of code which has multiple front ends. One front end is a WCF service, another is a console app that just launches some long running commands which perform financial calcs and other business logic. I am trying to figure out how to manage my ISession in the console app. I 'could' just have one session per "command", bu...

Console App Service or ATL Service

I need to create a service. I know that you can do it with just a console application but it can also be done with ATL.. What are the benefits of the ATL Service vs a simple console application service? I understand that ATL is COM.. but what are the benefits of COM with the service.. thanks! ...

ClickOnce File Association

I have a console application that I'm deploying using ClickOnce. Once the user installs the program the associations are set but the associated program is the installer(ClickOnce Application Deployment Support Library) and not the actual program. How can I get the association to be the actual program and not the installer? I've includ...