uses FileCtrl;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> sTempPath: array[0..255] of char;<br> dir: string;<br> guid: TGuid;<br>begin<br> //在临时目录下生成一个临时文件夹<br> GetTempPath( 255, sTempPath);<br> Filename := sPath;<br> CreateGUID(Guid);<br> dir := dir + '/' + GuidToString(Guid);<br> if not DirectoryExists(dir) then<br> if not CreateDir('C:/temp') then<br> raise Exception.Create('Cannot create ' + dir);<br>end;<br>