Version.MinorRevision Propiedad

Definición

Obtiene los 16 bits inferiores del número de revisión.

public:
 property short MinorRevision { short get(); };
public short MinorRevision { get; }
member this.MinorRevision : int16
Public ReadOnly Property MinorRevision As Short

Valor de propiedad

Entero de 16 bits con signo.

Ejemplos

En el ejemplo de código siguiente se muestra el Version constructor y las Majorpropiedades , RevisionMinorBuild, MajorRevisiony MinorRevision .

// This example demonstrates the Version.Revision,
// MajorRevision, and MinorRevision properties.
using namespace System;

int main()
{
    String^ formatStandard = "Standard version:\n" +
        " major.minor.build.revision = {0}.{1}.{2}.{3}";
    String^ formatInterim = "Interim version:\n" +
        " major.minor.build.majRev/minRev = {0}.{1}.{2}.{3}/{4}";

    Version^ standardVersion = gcnew Version(2, 4, 1128, 2);
    Version^ interimVersion = gcnew Version(2, 4, 1128, (100 << 16) + 2);

    Console::WriteLine(formatStandard, standardVersion->Major, 
        standardVersion->Minor, standardVersion->Build, 
        standardVersion->Revision);
    Console::WriteLine(formatInterim, interimVersion->Major,
        interimVersion->Minor, interimVersion->Build, 
        interimVersion->MajorRevision, interimVersion->MinorRevision);
};
/*
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

*/
// This example demonstrates the Version.Revision,
// MajorRevision, and MinorRevision properties.
using System;

class Sample 
{
    public static void Main() 
    {

    string fmtStd = "Standard version:\n" +
                    "  major.minor.build.revision = {0}.{1}.{2}.{3}";
    string fmtInt = "Interim version:\n" +
                    "  major.minor.build.majRev/minRev = {0}.{1}.{2}.{3}/{4}";

    Version std = new Version(2, 4, 1128, 2);
    Version interim = new Version(2, 4, 1128, (100 << 16) + 2);

    Console.WriteLine(fmtStd, std.Major, std.Minor, std.Build, std.Revision);
    Console.WriteLine(fmtInt, interim.Major, interim.Minor, interim.Build, 
                              interim.MajorRevision, interim.MinorRevision);
    }
}
/*
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

*/
// This example demonstrates the Version.Revision,
// MajorRevision, and MinorRevision properties.
open System

let std = Version(2, 4, 1128, 2)
let interim = Version(2, 4, 1128, (100 <<< 16) + 2)

printfn $"Standard version:\n  major.minor.build.revision = {std.Major}.{std.Minor}.{std.Build}.{std.Revision}"
printfn $"Interim version:\n  major.minor.build.majRev/minRev = {interim.Major}.{interim.Minor}.{interim.Build}.{interim.MajorRevision}/{interim.MinorRevision}"

// 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
' This example demonstrates the Version.Revision,
' MajorRevision, and MinorRevision properties.

Class Sample
    Public Shared Sub Main() 
        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.majRev/minRev = {0}.{1}.{2}.{3}/{4}"
        
        Dim std As New Version(2, 4, 1128, 2)
        Dim interim As New Version(2, 4, 1128, (100 << 16) + 2)
        
        Console.WriteLine(fmtStd, std.Major, std.Minor, std.Build, std.Revision)
        Console.WriteLine(fmtInt, interim.Major, interim.Minor, interim.Build, _
                          interim.MajorRevision, interim.MinorRevision)
    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
'

Comentarios

Supongamos que publica una versión provisional de la aplicación para corregir temporalmente un problema hasta que pueda liberar una solución permanente. La versión temporal no garantiza un nuevo número de revisión, pero debe identificarse como una versión diferente. En este caso, codifique la información de identificación en las partes de 16 bits altas y bajas del número de revisión de 32 bits. Utilice la Revision propiedad para obtener el número de revisión completo, utilice la MajorRevision propiedad para obtener los 16 bits altos y utilice la MinorRevision propiedad para obtener los 16 bits bajos.

Se aplica a

Consulte también