Skip to content

Instantly share code, notes, and snippets.

@jonsagara
Created October 30, 2014 16:30
Show Gist options
  • Save jonsagara/d499e2151756b6022b77 to your computer and use it in GitHub Desktop.
Save jonsagara/d499e2151756b6022b77 to your computer and use it in GitHub Desktop.
Snippet for a "Press any key to quit..." prompt in a Visual Studio C# console application
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>AnyKeyQuit</Title>
<Author>Jon Sagara</Author>
<Description>Inserts a &quot;Press any key to quit...&quot; prompt</Description>
<Shortcut>quit</Shortcut>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[
Console.WriteLine("Press any key to quit...");
Console.ReadKey();]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
@jonsagara
Copy link
Author

  1. Install this here: %USERPROFILE%\Documents\Visual Studio 2013\Code Snippets\Visual C#\My Code Snippets
  2. Be sure to change the file extension to .snippet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment