谢谢了,急!

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, ComCtrls, ShellCtrls, IdGlobal;//加入最后这个单元type
      TForm1 = class(TForm)
        ShellListView1: TShellListView;
        btn1: TButton;
        procedure btn1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.btn1Click(Sender: TObject);
    var FileSize:integer;
    begin
      if not ShellListView1.SelectedFolder.IsFolder then
      begin
        FileSize:=FileSizeByName(ShellListView1.SelectedFolder.PathName);
        ShowMessage(IntToStr(FileSize));
      end;
    end;end.