FileVersionInfo.ProductMajorPart 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 partie principale du numéro de version du produit avec lequel ce fichier est associé.
public:
property int ProductMajorPart { int get(); };
public int ProductMajorPart { get; }
member this.ProductMajorPart : int
Public ReadOnly Property ProductMajorPart As Integer
Valeur de propriété
Valeur représentant la partie principale du numéro de version du produit 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 ProductMajorPart contenu dans une zone de texte. Ce code suppose qu’il textBox1 a été instancié.
private void GetProductMajorPart()
{
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo =
FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");
// Print the product major part number.
textBox1.Text = "Product major part number: " + myFileVersionInfo.ProductMajorPart;
}
Private Sub GetProductMajorPart()
' Get the file version for the notepad.
Dim myFileVersionInfo As FileVersionInfo = _
FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
' Print the product major part number.
textBox1.Text = "Product major part number: " & myFileVersionInfo.ProductMajorPart
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.
Cette propriété obtient le premier ensemble de 16 bits.