createdirectory是布你型的函数,可以判断它创建成功否。 使用递归算法实现。 程序如下: function SubStr(vat dir:string):string; begin ... end;if not Createdirectory(Pchar(edit1.txt),null) then begin ... end;
procedure TForm1.Button1Click(Sender: TObject);var Dir: string; begin Dir := 'C:\APPS\SALES\LOCAL'; if ForceDirectories(Dir) then Label1.Caption := Dir + ' was created'end;
使用递归算法实现。
程序如下:
function SubStr(vat dir:string):string;
begin
...
end;if not Createdirectory(Pchar(edit1.txt),null) then
begin
...
end;
Dir: string;
begin Dir := 'C:\APPS\SALES\LOCAL'; if ForceDirectories(Dir) then
Label1.Caption := Dir + ' was created'end;