FileVersionInfo.LegalCopyright 属性

定义

获取所有适用于指定文件的版权声明。

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

属性值

适用于指定文件的版权声明。

示例

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

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

        // Print the copyright notice.
        textBox1->Text = String::Concat( "Copyright notice: ", myFileVersionInfo->LegalCopyright );
    }
private void GetCopyright()
{
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo =
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");

    // Print the copyright notice.
    textBox1.Text = "Copyright notice: " + myFileVersionInfo.LegalCopyright;
}
Private Sub GetCopyright()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
    
    ' Print the copyright notice.
    textBox1.Text = "Copyright notice: " & myFileVersionInfo.LegalCopyright
End Sub

注解

这应包括所有声明、法律符号、版权日期等的完整文本,或者 null 文件不包含版本信息时。

适用于