FileVersionInfo.FileName Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the name of the file that this instance of FileVersionInfo describes.
public:
property System::String ^ FileName { System::String ^ get(); };
public string FileName { get; }
member this.FileName : string
Public ReadOnly Property FileName As String
Property Value
The name of the file described by this instance of FileVersionInfo.
Examples
The following example calls GetVersionInfo to get the FileVersionInfo for the Notepad. Then it prints the FileName in a text box. This code assumes textBox1
has been instantiated.
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
Applies to
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา