if not DirectoryExists('c:\temp') then
    if not CreateDir('C:\temp') then
    raise Exception.Create('Cannot create c:\temp');

解决方案 »

  1.   

    uses FileCtrl;CreateDir('C:\temp') //创建目录
      

  2.   

    if not DirectoryExists(_FilePath) then  {如果路经不存}
           ForceDirectories(_FilePath); {建立路径}
      

  3.   

    uses FileCtrl;
    ....
    var sResultDir:String;
    begin
      sResultDir:='';
      if SelectDirectory('请选择目录','',sResultDir) then
        CreateDir(sResultDir+'\temp') 
    end;
      

  4.   

    文件夹是建立起来了,但我想这个文件是一个自定义的文件夹,能用DELPHI实现吗?
      

  5.   

    CreateDirectoryEx('C:\WINDOWS','D:\MyDir',0);
    这样你就可以得到一个和WINDOWS属性一样的文件夹了!
      

  6.   

    可以呀。
    其实,www.softdiy.com  我和我朋友办的。我已经在BORLADN编程的版里面把这个说出来了。
    用一个API的函数就可以搞定了。还有源程序。http://61.129.81.122/yuleibo/bbs/uploadImages/200271145058165.zip上面有更加详细的参数的数值。www.softdiy.com  有时间过来交流一下哟。