語言

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 = "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

備註

若此值為 true, PrivateBuild 則將描述此版本檔案與標準版本的差異。

適用於

另請參閱