如何创建目录,子目录(5分)

  • 主题发起人 主题发起人 d_dman
  • 开始时间 开始时间
一种方法即可,先到先得
 
用api:
BOOL CreateDirectory(
LPCTSTR lpPathName, // pointer to a directory path string
LPSECURITY_ATTRIBUTES lpSecurityAttributes // pointer to a security descriptor
);
 
ForceDirectories creates all the directories along a directory path if theydo
not already exist.
Unit
FileCtrl
Category
file management routines
procedure ForceDirectories(Dir: string);
Description
DOS and Windows only allow directories to be created one at a time. For example, to create the C:/APPS/SALES/LOCAL directory, the APPS and SALES directories must exist before the LOCAL directory can be created. Use ForceDirectories to create a directory and all parent directories thatdo
not already exist.
 
在SYSTEM UNIT 中
procedure mkdir(s : string);
创建目录
procedure getdir(d: byte;var s :string) ;得到当前目录
procedure chgdir(s :string) ;设定当前目录
example;
var s :string;
begin
getdir(2,s);// chgdir(s);换目录为当前目录
mkdir(yourdirname);
end;
 
我想要得是makedir谢谢!
 
多人接受答案了。
 
后退
顶部