共用方式為


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

適用於