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目录 为什么 ?请帮忙看看 应该怎么样改 谢谢!
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目录 为什么 ?请帮忙看看 应该怎么样改 谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货