このファイルに関連付けられている製品のビルド番号を取得します。
Public ReadOnly Property ProductBuildPart As Integer
[C#]
public int ProductBuildPart {get;}
[C++]
public: __property int get_ProductBuildPart();
[JScript]
public function get ProductBuildPart() : int;
プロパティ値
このファイルに関連付けられている製品のビルド番号を表す値。
解説
通常、バージョン番号は "メジャー番号.マイナ番号.ビルド番号.プライベート パート番号" の形式で表示されます。ファイル バージョン番号は、ファイルのバージョン番号を示す 64 ビットの数値であり、次のような構成になっています。
- 最初の 16 ビットは ProductMajorPart 番号です。
- 2 番目の 16 ビット値は、 ProductMinorPart 番号です。
- 3 番目の 16 ビット値は、 ProductBuildPart 番号です。
- 最後の 16 ビット値は、 ProductPrivatePart 番号です。
このプロパティは、3 番目の 16 ビット値を取得します。
使用例
GetVersionInfo を呼び出して、メモ帳の FileVersionInfo を取得する例を次に示します。次に、 ProductBuildPart をテキスト ボックスに出力します。このコードは、 textBox1
がインスタンス化されていることを前提にしています。
Private Sub GetProductBuildPart()
' Get the file version for the notepad.
Dim myFileVersionInfo As FileVersionInfo = _
FileVersionInfo.GetVersionInfo("%systemroot%\Notepad.exe")
' Print the product build part number.
textBox1.Text = "Product build part number: " & myFileVersionInfo.ProductBuildPart
End Sub 'GetProductBuildPart
[C#]
private void GetProductBuildPart() {
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
// Print the product build part number.
textBox1.Text = "Product build part number: " + myFileVersionInfo.ProductBuildPart;
}
[C++]
private:
void GetProductBuildPart() {
// Get the file version for the notepad.
FileVersionInfo* myFileVersionInfo = FileVersionInfo::GetVersionInfo(S"%systemroot%\\Notepad.exe");
// Print the product build part number.
textBox1->Text = String::Format( S"Product build part number: {0}", __box(myFileVersionInfo->ProductBuildPart));
}
[JScript]
private function GetProductBuildPart() {
//Get the file version for the notepad.
var myFileVersionInfo : FileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
//Print the product build part number.
textBox1.Text = "Product build part number: " + myFileVersionInfo.ProductBuildPart;
}
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
FileVersionInfo クラス | FileVersionInfo メンバ | System.Diagnostics 名前空間 | ProductVersion | ProductMajorPart | ProductMinorPart | ProductPrivatePart