FileVersionInfo.Comments 屬性

定義

取得與檔案關聯的註解。

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

屬性值

與檔案關聯的註解,如果檔案未包含版本資訊,則為 null

範例

下列範例會呼叫 GetVersionInfo 以取得 FileVersionInfo [記事本] 的 。 然後它會列印文字框中的批注。 此程式代碼假設 textBox1 已具現化。

void GetComments()
{
    // Get the file version for the notepad.
    FileVersionInfo^ myFileVersionInfo =
        FileVersionInfo::GetVersionInfo(Environment::SystemDirectory + "\\Notepad.exe");
    // Print the comments in a text box.
    textBox1->Text = "Comments: " + myFileVersionInfo->Comments;
}
void GetComments()
{
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo =
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");
    // Print the comments in a text box.
    textBox1.Text = "Comments: " + myFileVersionInfo.Comments;
}
Sub GetComments()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
       FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")

    ' Print the comments in a text box.
    textBox1.Text = "Comments: " & myFileVersionInfo.Comments
End Sub

備註

此屬性包含可針對診斷目的顯示的其他資訊。

適用於