Udostępnij przez


FileVersionInfo.ProductVersion Właściwość

Definicja

Pobiera wersję produktu, z tym plikiem jest dystrybuowany.

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

Wartość właściwości

Wersja produktu, z którym jest dystrybuowany ten plik, lub null jeśli plik nie zawiera informacji o wersji.

Przykłady

Poniższe przykładowe wywołania GetVersionInfo w celu pobrania FileVersionInfo elementu dla Notatnika. Następnie drukuje element ProductVersion w polu tekstowym. W tym kodzie przyjęto założenie textBox1 , że zostało utworzone wystąpienie.

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

Uwagi

Zazwyczaj numer wersji jest wyświetlany jako "numer główny.numer pomocniczy.numer kompilacji.prywatny numer części". Numer wersji produktu to 64-bitowy numer, który zawiera numer wersji w następujący sposób:

Dotyczy

Zobacz też