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;多看看帮助吧.
同意楼上的说法!! CreateDir CreateDirectory 也可以,自己查帮助!!
function ForceDirectories(const Dir: string): Boolean; 可一创建多级目录
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;多看看帮助吧.
CreateDir
CreateDirectory
也可以,自己查帮助!!
可一创建多级目录