求解,如何获得filelistbox中的选中文件的文件名以及主文件名??

解决方案 »

  1.   

    procedure TForm1.FileListBox1DblClick(Sender: TObject);
    begin
        ShowMessage(FileListBox1.Items.Strings[FileListBox1.Itemindex]);
    end;
    主文件名是什么意思?
      

  2.   

    FileListBox1.Directory + FileListBox1.Items.Strings[FileListBox1.Itemindex]
      

  3.   

    是不是去掉路径的文件名:extractfileName(FileListBox1.Items.Strings[FileListBox1.Itemindex])
      

  4.   

    主文件名是不是去了扩展名的文件名?
    因为现在的windows系统支持文件名中可以出现“.”,所以我是用递归的查找最后一个“.”,再来取他前面的字符串来实现的