The My keyword is a novel concept that was introduced in the .NET Framework 2.0 to quickly give you access to your application, your users, your resources, the computer, or the network on which the application resides. The My keyword has been referred to as a way of speed-dialing common but complicated resources to which you need access. Using the My keyword, you can quickly access a wide variety of items, such as user details or specific settings of the requester browser.
Though not really considered a true namespace, the My object declarations that you make work in the same way as the .NET namespace structure you are used to working with. To give you an example, first look at how you get the user's machine name using the traditional namespace structure:
For this example, you simply need to use the Environment class and use this namespace to get at the MachineName property. The following shows how you would accomplish this same task using the My keyword:
Looking at this example, you may be wondering what the point is if the example that uses My is lengthier than the first example, which just works off of the Environment namespace. Remember that the point is not the length of what you type to access specific classes, but a logical way to find frequently accessed resources without spending a lot of time hunting for them. Would you have known to look in the Environment class to get the machine ...