delphi中怎么用OpenDialog1组件得到文件名,,

来源:百度知道 编辑:UC知道 时间:2024/06/01 07:25:47
form1.OpenDialog1.Execute ;
form1.ADOTable1.Fields[1].AsString :=form1.OpenDialog1.FileName;
这种得到是 f:\音乐\遇.mp3
现在我是想只要那个歌曲的名称

ExpandFileName() 返回文件的全路径(含驱动器、路径)
ExtractFileExt() 从文件名中抽取扩展名
ExtractFileName() 从文件名中抽取不含路径的文件名
ExtractFilePath() 从文件名中抽取路径名
ExtractFileDir() 从文件名中抽取目录名
ExtractFileDrive() 从文件名中抽取驱动器名
ExpandUNCFileName() 返回含有网络驱动器的文件全路径
ExtractRelativePath() 从文件名中抽取相对路径信息

用OpenDialog.FileName做参数

if opendialog1.execute then
.......= opendialog1.filename