共用方式為


FileVersionInfo.IsPreRelease 屬性

定義

取得數值,指定檔案是否為開發版本,而不是商業發行的產品。

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

屬性值

如果檔案是發行前的版本則為 true,否則為 false

範例

下列範例會呼叫 GetVersionInfo 以取得 FileVersionInfo [記事本] 的 。 然後會顯示此版本是否為文字框中的發行前版本。 此程式代碼假設 textBox1 已具現化。

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

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

     // Print whether the file is a prerelease version.
     textBox1.Text = "File is prerelease version " + myFileVersionInfo.IsPreRelease;
}
Private Sub GetIsPreRelease()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
    
    ' Print whether the file is a prerelease version.
    textBox1.Text = "File is prerelease version " & myFileVersionInfo.IsPreRelease
End Sub

適用於