FileVersionInfo.CompanyName 属性

定义

获取生成该文件的公司的名称。

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

属性值

生成该文件的公司的名称,或者 null 该文件是否不包含版本信息。

示例

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

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

    // Print the company name.
    textBox1.Text = "The company name: " + myFileVersionInfo.CompanyName;
}
Private Sub GetCompanyName()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")

    ' Print the company name.
    textBox1.Text = "The company name: " & myFileVersionInfo.CompanyName
End Sub

适用于