Version.MajorRevision Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets the high 16 bits of the revision number.
Assembly: mscorlib (in mscorlib.dll)
Suppose you release an interim version of your application to temporarily correct a problem until you can release a permanent solution. The temporary version does not warrant a new revision number, but it does need to be identified as a different version. In this case, encode the identification information in the high and low 16-bit portions of the 32-bit revision number. Use the Revision property to obtain the entire revision number, use the MajorRevision property to obtain the high 16 bits, and use the MinorRevision property to obtain the low 16 bits.
Starting in the .NET Framework version 2.0, the Windows NT operating system uses the MajorRevision property to encode the service pack number.
The following code example demonstrates the Version constructor, and the Major, Minor, Build, Revision, MajorRevision, and MinorRevision properties.
' This example demonstrates the Version.Revision property. Class Example Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock) Dim fmtStd As String = "Standard version:" & vbCrLf & _ " major.minor.build.revision = {0}.{1}.{2}.{3}" Dim fmtInt As String = "Interim version:" & vbCrLf & _ " major.minor.build.revision = {0}.{1}.{2}.{3}" Dim std As New Version(2, 4, 1128, 2) Dim interim As New Version(2, 4, 1128, (100 << 16) + 2) outputBlock.Text &= String.Format(fmtStd, std.Major, std.Minor, std.Build, std.Revision) & vbCrLf outputBlock.Text &= String.Format(fmtInt, interim.Major, interim.Minor, interim.Build, _ interim.Revision) & vbCrLf End Sub End Class ' 'This code example produces the following results: ' 'Standard version: ' major.minor.build.revision = 2.4.1128.2 'Interim version: ' major.minor.build.majRev/minRev = 2.4.1128.100/2 '