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

适用于