Handling the event System.Console.CancelKeyPress might help you.
MSDN explains it how to handle this event along with other things that you need to take care of while handling this event, excerpt:
This event is used in conjunction with
System.ConsoleCancelEventHandler and System.ConsoleCancelEventArgs.
The CancelKeyPress event enables a console application to intercept
the CTRL+C signal so the application can decide whether to continue
executing or terminate.
Use this event to explicitly control how your application responds to
the CTRL+C signal. If your application has simple requirements, you
can use the TreatControlCAsInput property instead of this event.
The event handler for this event is executed on a thread pool thread.
Handling the event
System.Console.CancelKeyPress
might help you.MSDN explains it how to handle this event along with other things that you need to take care of while handling this event, excerpt:
Use ProcessExit event of the application domain