|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Using the .NET Framework Class Library (Visual C#)
Most Visual C# development projects use the .NET Framework Class Library extensively for everything from file system access and string manipulation to Windows Forms and ASP.NET user interface controls.
The class library is organized into namespaces, each of which contains a set of related classes and structs. For example, thenamespace contains numerous types that represent fonts, pens, lines, shapes, colors, and so on.
using Directives and References
Before you can use the classes in a given namespace in a C# program, you must add a using directive for that namespace to your C# source file. In some cases, you must also add a reference to the DLL that contains the namespace; Visual C# automatically adds references to the most commonly used class library DLLs. You can see which references have been added in Solution Explorer under the References node. For more information, see .
After you have added the using directive for a namespace, you can create instances of its types, call methods, and respond to events just as if they were declared in your own source code. In the Visual C# code editor, you can also put the insertion point over a type or member name, and press F1 to see the Help documentation. You can also use the Object Browser tool and Metadata As Source feature to see type information on .NET Framework classes and structs. For more information, see.
For More Information
For more information about the .NET Framework class library, seeand .
For more information about .NET Framework architecture, see.
On the Internet, the .NET Framework Developer Center has many articles and code examples about the class library.
For information about how to perform specific tasks using the class libraries, seeor click How Do I on the Help menu in Visual C#.