我想对Filelistbox中显示的文件进行批量重命名我因该怎么做

解决方案 »

  1.   

    for i := 0 to (Filelistbox.count-1) do 
    begin
      FileListBox.FileName[i] := FileListBox.FileName[i]+inttostr(i)
    end;
    没有用过filelistbox,可能这样应该可以。
      

  2.   

    procedure TForm1.Button2Click(Sender: TObject);
    var
    i:integer;
    old,new:string;
    begin
    for i:=0 to (filelistbox1.Count-1) do
    old:=filelistbox1.FileName;
    showmessage(old);
    new:=filelistbox1.FileName+inttostr(i)+'xxx';
    If RenameFile(old,new)=true thenfilelistbox1.Update
    else
    showmessage('有重名文件');end;
    end.我是这样写的但是也不行
    help