Another RAD feature introduced in Visual Basic 2005 is called My. My is a set of objects that contain commonly used functions related to the computer, the application, the user, and so forth. You can think of My as a speed-dial to get to functions that would otherwise require a lot of extra code.
For example, suppose that you want to determine the version number of your application. In the previous version of Visual Basic, the code would have looked like the following.
Dim VersionNumber As String
VersionNumber = System.Diagnostics.FileVersionInfo.GetVersionInfo _ (System.Reflection.Assembly.GetExecutingAssembly.Location).FileVersion
Using the new My.Application object, it looks like this.
Dim VersionNumber As String
VersionNumber = My.Application.Info.Version.ToString
As you can see, the My way is much simpler (and much easier to discover), saving you time and effort. You could still use the other way of determining the version number, by why would you?
Although you may not have noticed, you have already used My in a number of earlier lessons. As you enter code for your next application, explore the My objects by typing My and drilling down through the list of items that appears. For more information, see Development with My.