FileVersionInfo.ProductVersion Свойство

Определение

Получает версию продукта, с которым распространяется этот файл.

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

Значение свойства

Версия продукта, с которым распространяется этот файл, или значение null, если файл не содержал сведения о версии.

Примеры

В следующем примере вызывается GetVersionInfo для получения FileVersionInfo для Блокнота. Затем он выводит в ProductVersion текстовое поле. В этом коде предполагается textBox1 , что был создан экземпляр .

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

Комментарии

Как правило, номер версии отображается как "основное число.дополнительный номер.номер сборки.частный номер части". Номер версии продукта — это 64-разрядное число, которое содержит номер версии следующим образом:

Применяется к

См. также раздел