FileVersionInfo.IsPatched 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會取得一個值,說明檔案是否被修改,且是否與原始版本號的出貨檔案不完全相同。
public:
property bool IsPatched { bool get(); };
public bool IsPatched { get; }
member this.IsPatched : bool
Public ReadOnly Property IsPatched As Boolean
屬性值
true如果檔案有修補;否則,。 false
範例
以下範例要求 GetVersionInfo 取得 FileVersionInfo 記事本。 接著它會在文字框中顯示布林值 IsPatched 的狀態。 此程式碼假設 textBox1 已被實例化。
private void GetIsPatched()
{
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo =
FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");
// Print whether the file has a patch installed.
textBox1.Text = "File has patch installed: " + myFileVersionInfo.IsPatched;
}
Private Sub GetIsPatched()
' Get the file version for the notepad.
Dim myFileVersionInfo As FileVersionInfo = _
FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
' Print whether the file has a patch installed.
textBox1.Text = "File has patch installed: " & myFileVersionInfo.IsPatched
End Sub