FileVersionInfo.IsDebug 属性

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

**命名空间:**System.Diagnostics
**程序集:**System(在 system.dll 中)

语法

声明
Public ReadOnly Property IsDebug As Boolean
用法
Dim instance As FileVersionInfo
Dim value As Boolean

value = instance.IsDebug
public bool IsDebug { get; }
public:
property bool IsDebug {
    bool get ();
}
/** @property */
public boolean get_IsDebug ()
public function get IsDebug () : boolean

属性值

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

备注

FileVersionInfo 属性基于该文件中内置的版本资源信息。版本资源通常内置在二进制文件(如 .exe 或 .dll 文件)中;文本文件不具有版本资源信息。

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

示例

下面的示例调用 GetVersionInfo 来获取“记事本”(Notepad) 的 FileVersionInfo。然后,它在文本框内显示布尔值 IsDebug 的状态。这段代码假定已经实例化 textBox1

Private Sub GetIsDebug()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo("%systemroot%\Notepad.exe")
    
    ' Print whether the file contains debugging information.
    textBox1.Text = "File contains debugging information: " & myFileVersionInfo.IsDebug
End Sub 'GetIsDebug
private void GetIsDebug() {
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    // Print whether the file contains debugging information.
    textBox1.Text = "File contains debugging information: " +
       myFileVersionInfo.IsDebug;
 }
    
private:
   void GetIsDebug()
   {
      // Get the file version for the notepad.
      FileVersionInfo^ myFileVersionInfo = FileVersionInfo::GetVersionInfo( "%systemroot%\\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("%systemroot%\\Notepad.exe");

    // Print whether the file contains debugging information.
    textBox1.set_Text("File contains debugging information: " 
        + myFileVersionInfo.get_IsDebug());
} //GetIsDebug
private function GetIsDebug() {
    //Get the file version for the notepad.
    var myFileVersionInfo : FileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    //Print whether the file contains debugging information.
    textBox1.Text = "File contains debugging information: " +
       myFileVersionInfo.IsDebug;
 }
    

平台

Windows 98、Windows 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

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

FileVersionInfo 类
FileVersionInfo 成员
System.Diagnostics 命名空间