Share via


FileVersionInfo.IsDebug 属性

定义

获取一个值,该值指定文件是否包含调试信息或在调试功能启用的情况下进行编译。

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

属性值

如果文件包含调试信息或在调试功能启用的情况下进行编译,值为 true;反之,值为 false

示例

以下示例调用 GetVersionInfo 以获取 FileVersionInfo 记事本的 。 然后,它会在文本框中显示布尔 IsDebug 值的状态。 此代码假定 textBox1 已实例化。

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

注解

这些 FileVersionInfo 属性基于文件中内置的版本资源信息。 版本资源通常内置于二进制文件中,例如 .exe 或 .dll 文件;文本文件没有版本资源信息。

版本资源通常在 Win32 资源文件或程序集属性中指定。 属性 IsDebug 反映 VS_FF_DEBUG 文件的 VS_FIXEDFILEINFO 块中的标志值,该块是从 VERSIONINFO Win32 资源文件中的资源生成的。 有关在 Win32 资源文件中指定版本资源的详细信息,请参阅平台 SDK About Resource Files 主题和 VERSIONINFO Resource 主题主题。

适用于