FileVersionInfo.FileBuildPart 属性

定义

获取文件的生成号。

public:
 property int FileBuildPart { int get(); };
public int FileBuildPart { get; }
member this.FileBuildPart : int
Public ReadOnly Property FileBuildPart As Integer

属性值

一个表示文件内部版本号的值,或者 null 该文件是否不包含版本信息。

示例

以下示例调用 GetVersionInfo 获取 FileVersionInfo 记事本。 然后,它将打印 FileBuildPart 在文本框中。 此代码假定 textBox1 已实例化。

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

    // Print the file build number.
    textBox1.Text = "File build number: " + myFileVersionInfo.FileBuildPart;
}
Private Sub GetFileBuildPart()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
    
    ' Print the file build number.
    textBox1.Text = "File build number: " & myFileVersionInfo.FileBuildPart
End Sub

注解

通常,版本号显示为“major number.minor number.build number.private part number”。 文件版本号是包含文件的版本号的 64 位数字,如下所示:

此属性获取第三组 16 位。

适用于

另请参阅