当然如果能将该文件对象读到里面更好,如果不能,将文件名称读到里面也可以。
谢谢各位了!

解决方案 »

  1.   

    哦,我想我是让大家误倒了哈,我是想能够将文件夹里的文件名称写入里面,但是如果每一个Item能够对应一个文件,当然这是写在ComboBox中的对象,当选用某个Item时才方面直接调用。
      

  2.   

    具体如何操作?
    我这里怎么没有找到,
    我用的是Delphi 6。
      

  3.   

    用FindFirstFile、FindNext、FindClose三个函数全部搞定,读取到了文件名就把文件名加入到ComboBox中就可以了
      

  4.   

    procedure findall(disk path: String; var fileresult: Tstrings); 
    var 
    fpath: String; 
    fs: TsearchRec; 
    begin 
     fpath:=disk+path+'\*.*'; 
     if findfirst(fpath faAnyFile fs)=0 then 
       begin 
       if (fs.Name<>'.')and(fs.Name<>'..') then 
         if (fs.Attr and faDirectory)=faDirectory then 
             findall(disk path+'\'+fs.Name fileresult) 
           else 
             fileresult.add(disk+strpas(strupper(pchar(path)))+'\'+strpas(
    strupper(pchar(fs.Name)))+'('+inttostr(fs.Size)+')'); 
         while findnext(fs)=0 do 
           begin 
           if (fs.Name<>'.')and(fs.Name<>'..') then 
             if (fs.Attr and faDirectory)=faDirectory then 
                 findall(disk path+'\'+fs.Name fileresult) 
               else 
                 fileresult.add(disk+strpas(strupper(pchar(path)))+'\'+str
    pas(strupper(pchar(fs.Name)))+'('+inttostr(fs.Size)+')'); 
           end; 
       end; 
     findclose(fs); 
    end;
    不好意思。比较乱!fileresult就是你要的。你改改吧!
      

  5.   

    Linux2001(我想买手提电脑啊!) ( )  还是大哥说的好
     
     找到你要添加的文件名写到combobox的item里面