Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileVersionInfo.IsPatched Property

Gets a value that specifies whether the file has been modified and is not identical to the original shipping file of the same version number.

Namespace: System.Diagnostics
Assembly: System (in system.dll)

public bool IsPatched { get; }
/** @property */
public boolean get_IsPatched ()

public function get IsPatched () : boolean

Not applicable.

Property Value

true if the file is patched; otherwise, false.

The following example calls GetVersionInfo to get the FileVersionInfo for the Notepad. Then it displays the state of the Boolean IsPatched in a text box. This code assumes textBox1 has been instantiated.

private void GetIsPatched() {
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    // Print whether the file has a patch installed.
    textBox1.Text = "File has patch installed: " + myFileVersionInfo.IsPatched;
 }
    

private void GetIsPatched()
{
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo = 
        FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");

    // Print whether the file has a patch installed.
    textBox1.set_Text("File has patch installed: " 
        + myFileVersionInfo.get_IsPatched());
} //GetIsPatched

private function GetIsPatched() {
    //Get the file version for the notepad.
    var myFileVersionInfo : FileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    //Print whether the file has a patch installed.
    textBox1.Text = "File has patch installed: " + myFileVersionInfo.IsPatched;
 }
    

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft