FileVersionInfo.ProductVersion Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient la version du produit avec lequel ce fichier est distribué.
public:
property System::String ^ ProductVersion { System::String ^ get(); };
public string ProductVersion { get; }
member this.ProductVersion : string
Public ReadOnly Property ProductVersion As String
Valeur de propriété
La version du produit avec lequel ce fichier est distribué ou null si le fichier ne contenait pas d’informations de version.
Exemples
L’exemple d’appel GetVersionInfo suivant permet d’obtenir le FileVersionInfo Bloc-notes. Ensuite, il imprime le ProductVersion contenu dans une zone de texte. Ce code suppose qu’il textBox1 a été instancié.
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
Remarques
En règle générale, un numéro de version est affiché sous la forme « numéro.major number.minor number.build number.private part number ». Un numéro de version de produit est un numéro 64 bits qui contient le numéro de version comme suit :
Les 16 premiers bits sont le ProductMajorPart nombre.
Les 16 bits suivants sont le ProductMinorPart nombre.
Le troisième jeu de 16 bits est le ProductBuildPart nombre.
Les 16 derniers bits sont le ProductPrivatePart nombre.