findfirst(path,faAnyfile,sr) 
               ~~~~~~~~~看看这个参数,加些东东试试....

解决方案 »

  1.   

    参数faAnyfile不是 Any files的吗
      

  2.   

    Constant Value Description
    faReadOnly $00000001 Read-only files
    faHidden $00000002 Hidden files
    faSysFile $00000004 System files
    faVolumeID $00000008 Volume ID files
    faDirectory $00000010 Directory files
    faArchive $00000020 Archive files
    faAnyFile $0000003F Any file
      

  3.   

    Attributes can be combined by adding their constants or values. For example, to search for read-only and hidden files in addition to normal files, pass (faReadOnly + faHidden) as the Attr parameter.
      

  4.   

    哈哈,我碰到过!
    你的判断条件写错啦,应该是这样的
    if (sr.Attr and faDirectory)=faDirectory then//如果找到的是目录..而不是这样的
    if sr.Attr=faDirectory then//如果找到的是目录..
      

  5.   

    看看关于delphi中的vcl中的关于文件的源码