Introducing My

The My namespace provides shortcuts for accessing several common objects in .NET development. Basically My exposes classes that wrap existing built-in objects and reoffers them under an easier to use fashion. By using My, you can access lots of development areas generally writing less code than you would if you used usual techniques. At a higher level My exposes the following members:

My.Application, a property exposing members that allows access to other properties of the current application

My.Computer, a property exposing members that provides shortcuts to common operations with your machine, such as the file system or the Registry

My.Settings, a property that provides code support for the Settings tab in My Project and that also allows using settings from your application

My.Resources, a namespace that defines several objects providing support for the Resources tab in My Project and allowing handling resources in code

My.User, a property providing members for getting or setting information about the current user that logged into the operating system

My.WebServices, a property allowing retrieving information on web services consumed by your application

The preceding listed My members are the most general, and you can find them in every kind of Visual Basic application. There are also specific extensions for the My namespace related to specific applications, such as WPF. (A description is at the end of this chapter.) My is interesting because it can be also be extended with custom members providing great flexibility to your applications. If something within My does not satisfy you, you can change it. After all, My is a namespace, meaning that it is implemented in code.

“My” is a Reserved Keyword

Due to its particular role within the Visual Basic programming language, although it just refers to a namespace, My is also a reserved word in Visual Basic.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.201.32