初学delphi  望大虾指点啊

解决方案 »

  1.   

    FindFirst和Findnext分别枚举文件夹中的文件,然后比较
      

  2.   

    对于文件名,遍历目录比较吧对于文件内容,可以遍历取到两个目录的同名文件,放到内存流中比较流,CompareStream
      

  3.   

    我想遍历源目录得到文件名放到listbox中 然后去目标目录查找 但是我不能将TStringList 的内容放到Listbox中
      

  4.   

    老是出错误 不能读取Tstringlist中的内容
      

  5.   

    http://topic.csdn.net/u/20090630/14/55ba4779-0293-4cdc-9b5a-c19392b5b919.html这个贴子也是发的吧,还没解决吗,你是如何做的
      

  6.   

    tlist:Tstringlist然后Tlist:=TstringList.create;
    Listbox1.text:=Tlist;
    然后老是错误
      

  7.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
     i: integer;
     strList: TStringList;
    begin
      strList:=TstringList.create;
      try
        for i:=0 to 100 do
        begin
          strList.Add(IntToStr(i)+':'+formatdatetime('yyyy-mm-dd hh:mm:ss',now()));
        end;
        ListBox1.Items := strList;
      finally
        StrList.Free;
      end;
    end;
      

  8.   

    Tlist:=Find(DirectoryName1,Tlist);
    Listbox2.Items:=Tlist;
    然后出现了 cannot assign a nil to a TListBoxString 的错误
      

  9.   

    另类办法:
    使用dos命令
    tree c:\dir1 /f > d:\1.txt
    tree c:\dir2 /f > d:\2.txt
    然后从文件的第4行开始比较
      

  10.   


    Listbox1.text:=Tlist.text; 
      

  11.   


    你用阿三(10楼)的代码就行,你的错误在于Tlist:=Find(DirectoryName1,Tlist); 这句话,返回值为空