FileVersionInfo.CompanyName 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得產生檔案的公司名稱。
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 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