Extracts the name and extension parts of a file name. UnitSysUtilsCategoryfile name utilitiesDelphi syntax:function ExtractFileName(const FileName: string): string;C++ syntax:extern PACKAGE AnsiString __fastcall ExtractFileName(const AnsiString FileName);DescriptionThe resulting string is the rightmost characters of FileName, starting with the first character after the colon or backslash that separates the path information from the name and extension. The resulting string is equal to FileName if FileName contains no drive and directory parts.Note: This function works for multi-byte character systems (MBCS).
listbox1.items.add(extractfilename(opendialog1.filename))
这样就可以实现你所说的要求了