请问delphi里如何创建一个文件目录?例如在c盘下创建一个文件夹?

解决方案 »

  1.   

    Creates a new subdirectory.UnitSystemCategoryI/O routinesprocedure MkDir(S: string);DescriptionMkDir creates a new subdirectory with the path specified by string S. The last item in the path cannot be an existing file name.Note: {$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for an I/O error.uses Dialogs;
    begin  {$I-}
      { Get directory name from TEdit control }
      MkDir(Edit1.Text);
      if IOResult <> 0 then
        MessageDlg('Cannot create directory', mtWarning, [mbOk], 0)
      else
        MessageDlg('New directory created', mtInformation, [mbOk], 0);
    end;多看看帮助吧.
      

  2.   

    同意楼上的说法!!
    CreateDir
    CreateDirectory
    也可以,自己查帮助!!
      

  3.   

    function ForceDirectories(const Dir: string): Boolean;
    可一创建多级目录