经过测试没发现你的这种情况procedure TForm1.btn2Click(Sender: TObject); var Dir: string; i:Integer; const SELDIRHELP = 1000; begin Dir := 'C:\'; if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],SELDIRHELP) then begin lbl1.Caption := Dir; for i:=0 to 10 do begin Dir:=lbl1.Caption+'\'+'new'+inttostr(i); if not DirectoryExists(dir) then MkDir(dir); end; end; end;
var
Dir: string;
i:Integer;
const
SELDIRHELP = 1000;
begin
Dir := 'C:\';
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],SELDIRHELP) then
begin
lbl1.Caption := Dir;
for i:=0 to 10 do
begin
Dir:=lbl1.Caption+'\'+'new'+inttostr(i);
if not DirectoryExists(dir) then
MkDir(dir); end;
end;
end;