FileVersionInfo.FileDescription 属性

定义

获取文件说明。

public:
 property System::String ^ FileDescription { System::String ^ get(); };
public string? FileDescription { get; }
public string FileDescription { get; }
member this.FileDescription : string
Public ReadOnly Property FileDescription As String

属性值

文件说明,当文件不包含版本信息时则为 null

示例

以下示例调用 GetVersionInfo 以获取 FileVersionInfo 记事本的 。 然后,它会在文本框中打印 FileDescription 。 此代码假定 textBox1 已实例化。

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

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

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

适用于