次の方法で共有


FileVersionInfo.CompanyName プロパティ

ファイルを作成した会社名を取得します。

Public ReadOnly Property CompanyName As String
[C#]
public string CompanyName {get;}
[C++]
public: __property String* get_CompanyName();
[JScript]
public function get CompanyName() : String;

プロパティ値

ファイルを作成した会社名。

使用例

GetVersionInfo を呼び出して、メモ帳の FileVersionInfo を取得する例を次に示します。次に、 CompanyName をテキスト ボックスに出力します。このコードは、 textBox1 がインスタンス化されていることを前提にしています。

 
Private Sub GetCompanyName()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo("%systemroot%\Notepad.exe")
    
    ' Print the company name.
    textBox1.Text = "The company name: " & myFileVersionInfo.CompanyName
End Sub 'GetCompanyName

[C#] 
private void GetCompanyName() {
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    // Print the company name.
    textBox1.Text = "The company name: " + myFileVersionInfo.CompanyName;
 }
    

[C++] 
private:
void GetCompanyName() {
    // Get the file version for the notepad.
    FileVersionInfo* myFileVersionInfo = FileVersionInfo::GetVersionInfo(S"%systemroot%\\Notepad.exe");
 
    // Print the company name.
    textBox1->Text = String::Format( S"The company name: {0}", myFileVersionInfo->CompanyName );
 }
    

[JScript] 
private function GetCompanyName() {
    //Get the file version for the notepad.
    var myFileVersionInfo : FileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    //Print the company name.
    textBox1.Text = "The company name: " + myFileVersionInfo.CompanyName;
 }
    

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

FileVersionInfo クラス | FileVersionInfo メンバ | System.Diagnostics 名前空間