请问如何简单编写打开文件夹的代码?就像frontpage新建网站时设定文件夹一样。

解决方案 »

  1.   

    用opendialog1
    然后 if  opendialog1.execute then ...............
      

  2.   

    前面加:uses shellapi;
    假如你在edit1中输入文件或文件夹名:
    var: rstr:pchar;
    begin
      rstr:=pchar(edit1.text);
      shellexecute(handle,'open',pchar(rstr),nil,nil,SW_MAXIMIZE);
    end;//没在delphi中写的,你自己看看吧 !相信你能搞定的
      

  3.   

    use FileCtrlvar
      Dir: string;
    begin
      Dir := '';
      if SelectDirectory('','',dir) then
        Caption := Dir;
    end;