用Delphi如获得硬盘上文件的字节、属于等等?谢谢。

解决方案 »

  1.   

    uses shellapi; procedure getshellinfo(a:tfilename;var name,typ:string;var icon:ticon;var attr:integer);
    var 
      info : tshfileinfo;
    begin
      fillchar(info,sizeof(tshfileinfo),0);
      shgetfileinfo(pchar(a),0,info,sizeof(info),shgfi_displayname or shgfi_typename or shgfi_icon or shgfi_attributes);
      with info do begin
         name := szdisplayname;
         typ  := sztypename;
         icon.handle := hicon;
         attr := dwattributes;
         end;
    end;