Język

FileVersionInfo.IsPatched Właściwość

Definicja

Pobiera wartość określającą, czy plik został zmodyfikowany i nie jest identyczny z oryginalnym plikiem wysyłkowym tego samego numeru wersji.

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

Wartość właściwości

true jeśli plik jest poprawiony; w przeciwnym razie, false.

Przykłady

Poniższe przykładowe wywołania GetVersionInfo , aby pobrać FileVersionInfo element dla Notatnika. Następnie wyświetla stan wartości logicznej IsPatched w polu tekstowym. Ten kod zakłada, że textBox1 wystąpienie zostało utworzone.

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

Dotyczy