FileVersionInfo.IsDebug Właściwość

Definicja

Pobiera wartość określającą, czy plik zawiera informacje o debugowaniu, czy jest kompilowany z włączonymi funkcjami debugowania.

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

Wartość właściwości

true jeśli plik zawiera informacje o debugowaniu lub jest kompilowany z włączonymi funkcjami debugowania; w przeciwnym razie , false.

Przykłady

Poniższe przykładowe wywołania GetVersionInfo w celu pobrania FileVersionInfo notatnika. Następnie wyświetla stan wartości logicznej IsDebug w polu tekstowym. W tym kodzie założono, że textBox1 wystąpienie zostało utworzone.

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

        // Print whether the file contains debugging information.
        textBox1->Text = String::Concat( "File contains debugging information: ",
            myFileVersionInfo->IsDebug );
    }
private void GetIsDebug()
{
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo =
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");

    // Print whether the file contains debugging information.
    textBox1.Text = "File contains debugging information: " +
        myFileVersionInfo.IsDebug;
}
Private Sub GetIsDebug()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
    
    ' Print whether the file contains debugging information.
    textBox1.Text = "File contains debugging information: " & myFileVersionInfo.IsDebug
End Sub

Uwagi

Właściwości FileVersionInfo są oparte na informacjach o zasobie wersji wbudowanych w plik. Zasoby wersji są często wbudowane w pliki binarne, takie jak pliki .exe lub .dll; pliki tekstowe nie mają informacji o zasobie wersji.

Zasoby wersji są zwykle określane w pliku zasobów Win32 lub w atrybutach zestawu. Właściwość IsDebug odzwierciedla VS_FF_DEBUG wartość flagi w bloku pliku VS_FIXEDFILEINFO , który jest zbudowany z VERSIONINFO zasobu w pliku zasobów Win32. Aby uzyskać więcej informacji na temat określania zasobów wersji w pliku zasobów Win32, zobacz temat i VERSIONINFO Resource tematy dotyczące zestawu SDK About Resource Files platformy.

Dotyczy