Tim Van Wassenhove

Passionate geek, interested in Technology. Proud father of two

05 Aug 2006

Inserting pause to your Console Applications

When i write Console Applications i find myself to write the following two lines quite often

Console.Write("{0}Press any key to continue...", Environment.NewLine);
Console.ReadKey();

As you already know i’m lazy so i decided to write an IntelliSense Code Snippet. When i type “pau” Intellisense show the following:

Intellisense drop down list

Next i hit the tab button twice and i get the following effect:

Intellisense code snippet

Download pause.txt and save it as Pause.snippet in your %My DocumentS\Visual Studio 2005\Code Snippets\Visual C#\My Code Snippets% folder.

I’ve made it even simpler, you can install the snippet by simply running the pause.vsi package (Visual Studio Installer).