Aracılığıyla paylaş


Visual Basic Sample Applications

In the Visual Basic documentation, a sample is a Visual Basic project you can load into Visual Studio and run. An example is a small block of code that demonstrates a single, limited programming task. A snippet is a block of code that is inserted in the Code Editor using the IntelliSense Code Snippet feature.

To access samples from Visual Studio

  • On the Help menu, click Samples.

    By default, these samples are installed in drive:\Program Files\Microsoft Visual Studio 10.0\Samples\.

For the most current samples, see the Visual Basic Samples Web site.

Security noteSecurity Note

Microsoft provides the included samples "AS IS" with no warranties. The code in the samples is provided just to illustrate concepts. The provided code may not meet security requirements for any specific environment. We recommend that you add security and error-handling code to your projects to make them as secure and robust as you deem appropriate.

The following table describes samples that demonstrate new features in Visual Studio 2010.

Sample

Description

Auto-Implemented Properties

Demonstrates how to define and use auto-implemented properties. For more information, see "Properties and Fields" in Object-Oriented Programming (C# and Visual Basic).

Collection Initializers Sample

Shows how you can use collection initializer syntax to create arrays and collections. For more information, see Collection Initializers Overview (Visual Basic).

Covariance Sample

Shows how to create and use covariant and contravariant interfaces. For more information, see Covariance and Contravariance (C# and Visual Basic).

Implicit Line-Continuation Sample

Demonstrates the advantages of the implicit line-continuation feature, which enables you to continue a statement on the next consecutive line without using the underscore character (_). For a list of syntax elements for which the line-continuation character can be omitted, see "Implicit Line Continuation" in Statements in Visual Basic.

Lambda Expressions Sample

Demonstrates how to use single-line and multi-line lambda expressions. For more information, see Lambda Expressions (Visual Basic).

In This Section

See Also

Tasks

LINQ Samples

Concepts

Visual Basic IntelliSense Code Snippets

Visual Basic Coding Conventions

Other Resources

Visual Studio 2010 Samples

Visual Basic Programming Guide