Share via


FileVersionInfo.ProductVersion Vlastnost

Definice

Získá verzi produktu, se kterým je tento soubor distribuován.

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

Hodnota vlastnosti

Verze produktu, se kterým je tento soubor distribuován, nebo null pokud soubor neobsahuje informace o verzi.

Příklady

Následující příklad volá GetVersionInfo pro získání pro FileVersionInfo Poznámkový blok. Potom vypíše ProductVersion text v textovém poli. Tento kód předpokládá, že textBox1 došlo k vytvoření instance.

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

Poznámky

Číslo verze se obvykle zobrazuje jako "hlavní číslo.podverze.číslo buildu.číslo soukromé části". Číslo verze produktu je 64bitové číslo, které obsahuje následující číslo verze:

Platí pro

Viz také