Bagikan melalui


FileVersionInfo.FileName Properti

Definisi

Mendapatkan nama file yang dijelaskan instans FileVersionInfo ini.

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

Nilai Properti

Nama file yang dijelaskan oleh instans ini dari FileVersionInfo.

Contoh

Contoh berikut memanggil GetVersionInfo untuk mendapatkan FileVersionInfo untuk Notepad. Kemudian mencetak FileName dalam kotak teks. Kode ini mengasumsikan textBox1 telah dibuat.

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

        // Print the file name.
        textBox1->Text = String::Concat( "File name: ", myFileVersionInfo->FileName );
    }
private void GetFileName()
{
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo =
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");

    // Print the file name.
    textBox1.Text = "File name: " + myFileVersionInfo.FileName;
}
Private Sub GetFileName()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
    
    ' Print the file name.
    textBox1.Text = "File name: " & myFileVersionInfo.FileName
End Sub

Berlaku untuk