FileVersionInfo.Comments Właściwość

Definicja

Pobiera komentarze skojarzone z plikiem.

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

Wartość właściwości

Komentarze skojarzone z plikiem lub null jeśli plik nie zawiera informacji o wersji.

Przykłady

Poniższe przykładowe wywołania GetVersionInfo w celu pobrania FileVersionInfo elementu dla Notatnika. Następnie drukuje komentarze w polu tekstowym. W tym kodzie przyjęto założenie textBox1 , że zostało utworzone wystąpienie.

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

Uwagi

Ta właściwość zawiera dodatkowe informacje, które mogą być wyświetlane do celów diagnostycznych.

Dotyczy