FileVersionInfo.ProductVersion Propriedade
Definição
Obtém a versão do produto com que este arquivo é distribuído.Gets the version of the product this file is distributed with.
public:
property System::String ^ ProductVersion { System::String ^ get(); };
public string? ProductVersion { get; }
public string ProductVersion { get; }
member this.ProductVersion : string
Public ReadOnly Property ProductVersion As String
Valor da propriedade
A versão do produto com que este arquivo é distribuído ou null se o arquivo não continha informações de versão.The version of the product this file is distributed with or null if the file did not contain version information.
Exemplos
O exemplo a seguir chama GetVersionInfo para obter o FileVersionInfo bloco de notas.The following example calls GetVersionInfo to get the FileVersionInfo for the Notepad. Em seguida, ele imprime o ProductVersion em uma caixa de texto.Then it prints the ProductVersion in a text box. Esse código pressupõe que textBox1 tenha sido instanciado.This code assumes textBox1 has been instantiated.
private:
void GetProductVersion()
{
// Get the file version for the notepad.
FileVersionInfo^ myFileVersionInfo =
FileVersionInfo::GetVersionInfo( Environment::SystemDirectory + "\\Notepad.exe" );
// Print the product version number.
textBox1->Text = String::Concat( "Product version number: ", myFileVersionInfo->ProductVersion );
}
private void GetProductVersion()
{
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo =
FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");
// Print the product version number.
textBox1.Text = "Product version number: " + myFileVersionInfo.ProductVersion;
}
Private Sub GetProductVersion()
' Get the file version for the notepad.
Dim myFileVersionInfo As FileVersionInfo = _
FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
' Print the product version number.
textBox1.Text = "Product version number: " & myFileVersionInfo.ProductVersion
End Sub
Comentários
Normalmente, um número de versão é exibido como "número principal. número secundário. número da compilação. número da parte particular".Typically, a version number is displayed as "major number.minor number.build number.private part number". Um número de versão do produto é um número de 64 bits que contém o número de versão da seguinte maneira:A product version number is a 64-bit number that holds the version number as follows:
Os primeiros 16 bits são o ProductMajorPart número.The first 16 bits are the ProductMajorPart number.
Os próximos 16 bits são o ProductMinorPart número.The next 16 bits are the ProductMinorPart number.
O terceiro conjunto de 16 bits é o ProductBuildPart número.The third set of 16 bits are the ProductBuildPart number.
Os últimos 16 bits são o ProductPrivatePart número.The last 16 bits are the ProductPrivatePart number.