Chapter 36. Using the My Namespace

The .NET Framework is huge, containing thousands of classes that provide all sorts of useful features. To make finding things easier, the Framework is arranged in hierarchical groups called namespaces. For example, the System.Drawing namespace contains classes such as Pen, Brush, and Graphics that deal with drawing.

The My namespace is slightly different. It provides shortcuts to make performing common tasks easier. You can achieve many of the same results by using tools in other parts of the .NET Framework. My just gives you another, often easier way to find and use those tools.

In this lesson, you learn about the My namespace. After learning what tools it provides, you get to practice using some of the most useful of them.

MY SUB-NAMESPACES

The My namespace only contains tools for performing common tasks but the list of common tasks is big enough that finding what you need could be difficult. To make finding things within the My namespace easier, it is divided into the sub-namespaces summarized in Table 36-1.

Table 36.1. TABLE 36-1

SUB-NAMESPACE

PROVIDES TOOLS TO WORK WITH:

Application

The current application

Computer

The computer's software and hardware

Forms

Default instances of the application's forms

Resources

Application resources such as pictures or sound files

Settings

Program settings

User

The user

WebServices

Any Web Services used by the application (Web Services are fairly advanced, so they are not covered in this book.)

The following sections provide brief ...

Get Stephens' Visual Basic® Programming 24-Hour Trainer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.