if not DirectoryExists('c:/temp') then//判断文件夹是不是已经存在
if not CreateDir('C:/temp') then、//建立文件夹
raise Exception.Create('Cannot create c:/temp')//建立失败,抛出一个异常
借用一下小完的 :-)
if not DirectoryExists(Edit1.Text) then//判断文件夹是不是已经存在
if not CreateDir(Edit1.Text) then、//建立文件夹
raise Exception.Create('Cannot create ' + Edit1.Text)//建立失败,抛出一个异常