Console applications are still very useful for me.
I write like 125 console applications in the morning and like 4 or 5 in the afternoon.
In one of these applications that was running a long process I just started wandering:
what will happen with Lost? Will ABC ever finish this series?
And If someone presses Ctrl-C will I be able to catch it?
And indeed, the greate C# provides a very easi way to do it:
static void Main(string[] args)
{
Console.CancelKeyPress +=
delegate(object sender, ConsoleCancelEventArgs e)
{
Artinsoft.VBUMKernel.Implementations.UpgradeCommand.StopAllUpgradeProcess(true);
Console.WriteLine("Process aborted by user!");
};
//Long running process
}