FileVersionInfo.IsPrivateBuild 属性

定义

获取一个值,该值指定文件是否采用标准的发行过程生成。

public:
 property bool IsPrivateBuild { bool get(); };
public bool IsPrivateBuild { get; }
member this.IsPrivateBuild : bool
Public ReadOnly Property IsPrivateBuild As Boolean

属性值

如果文件为专用版本,值为 true;如果文件是采用标准发行过程生成的或如果文件不包含版本信息,则值为 false

示例

以下示例调用 GetVersionInfo 以获取 FileVersionInfo 记事本的 。 然后在文本框中显示专用生成信息。 此代码假定 textBox1 已实例化。

private:
    void GetIsPrivateBuild()
    {
        // Get the file version for the notepad.
        FileVersionInfo^ myFileVersionInfo =
            FileVersionInfo::GetVersionInfo( Environment::SystemDirectory + "\\Notepad.exe" );

        // Print whether the version is a private build.
        textBox1->Text = String::Concat( "Version is a private build: ", myFileVersionInfo->IsPrivateBuild );
    }
private void GetIsPrivateBuild()
{
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo =
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");

    // Print whether the version is a private build.
    textBox1.Text = "Version is a private build: " + myFileVersionInfo.IsPrivateBuild;
}
Private Sub GetIsPrivateBuild()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
    
    ' Print whether the version is a private build.
    textBox1.Text = "Version is a private build: " & myFileVersionInfo.IsPrivateBuild
End Sub

注解

如果此值为 truePrivateBuild 则描述此版本的文件与标准版本有何不同。

适用于

另请参阅