Visual Studio 2005 Code Snippets
IntelliSense Code Snippets are reusable, task-oriented blocks of code. Visual Studio 2005 includes code snippets covering tasks ranging from creating a custom exception, to sending an e-mail message, to drawing a circle. A set of Visual Basic and Visual C# Code Snippets are included in the Visual Studio 2005 box – additional Code Snippets can be found below.
Task-Based Code Snippets
This is a set of task-based code snippets in C# that can help you with programming tasks ranging from working with databases and windows applications to writing mobile device applications and networking programs. Note: Visual Basic versions of these snippets are included in the box.
Note: In order for Visual Studio to recognize the location of these snippets, you will need to add the installed directory to the Code Snippet Manager within Visual Studio (see How to: Manage Code Snippets).
You can also download the Visual C# code snippets by clicking on the categories below.
| Application Code Snippets For working with Isolated Storage, ClickOnce tasks, Console Applications and Process Management. |
| Collections and Arrays Code Snippets For tasks like creating, iterating, locating elements, and sorting collections like arrays and dictionaries. |
| Connectivity Code Snippets For checking network status, downloading a file via HTTP, performing serial port operations, sending email and more. |
| Crystal Reports Code Snippets For common reporting tasks such as printing a Crystal Report, setting report parameters, and configuring report data access. |
| Database Code Snippets For performing a variety of common tasks around ADO.NET data access. |
| Datatypes Code Snippets For various string conversions, date spanning operations, and other type-focused operations. |
| File System Code Snippets For performing a number of tasks around reading, writing, and managing files. |
| Math Code Snippets For calculating monthly payments, depreciation, sines, cosines, and random numbers. |
| Operating System Code Snippets A large collection of snippets for Event logging, Message Queues, Process management, registry access, windows services, getting system information and more. |
| Security Code Snippets For working with hashes, decrypting, encrypting, and getting a user’s name. |
| Smart Devices Code Snippets For performing common tasks on Smart Devices. |
| Windows Forms Code Snippets For working with the clipboard, fonts, sounds, GDI drawing, and general Windows Form and control creation. |
| XML Code Snippets For reading and writing XML, selecting nodes, performing XSL transforms, and other XML oriented tasks. |
| Refactoring Code Snippets These code snippets are used to restore the default set of snippets that C# refactoring currently uses for refactoring operations in the Visual Studio IDE. These snippets are installed by default with Visual Studio and should only be used to restore your C# refactoring snippets if they become corrupt or deleted. |
Visual Basic 2005 includes over 500 code snippets in the box. To learn more about Visual Basic Code Snippets, click here.
There are Visual Studio 2005 Tools for Office code snippets that you can download. Learn more about them
here.