procedure TForm1.Button2Click(Sender: TObject);
var
  Dir:string; //目录名称
begin
  Dir:=Edit1.Text;
  if DirectoryExists(Dir) then
    MessageDlg('目录'''+Dir+'''已经存在!'+#13+#10+'请指定新的目录!',mtInformation,[mbOK],0)
    else
    try
      if ForceDirectories(Dir) then //创建多级目录成功
        MessageDlg('目录'''+Dir+'''创建成功!',mtInformation,[mbOK],0);
        except
          on E:Exception do
          ShowMessage(E.Message);
          end;
end;
 DirectoryExists函数可以判断dir目录是否存在,但是ForceDirectories函数却不能创建dir目录 为什么 ?请帮忙看看 应该怎么样改 谢谢!