怎样用程序新建一个文件夹?在线等!急

flying310 2003-08-26 10:10:15
怎样用程序新建一个文件夹,请各位大虾帮忙。
...全文
77 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
沾上了甩不掉 2003-08-26
  • 打赏
  • 举报
回复
createdir('你的文件夹');
IORILI 2003-08-26
  • 打赏
  • 举报
回复
procedure makedir(modulname,pathname,dirname,filepath:string);
begin
try
if not directoryexists(frootpath+modulname) then
createdir(FRootPath+modulname);
if not DirectoryExists(FRootPath+modulname+'\'+pathname) then
createdir(FRootPath+modulname+'\'+pathname);
if not directoryexists(FRootPath+modulname+'\'+pathname+'\'+dirname) then
createdir(FRootPath+modulname+'\'+pathname+'\'+dirname);
if filepath<>'' then
if not directoryexists(FRootPath+modulname+'\'+pathname+'\'+dirname+'\'+filepath) then
createdir(FRootPath+modulname+'\'+pathname+'\'+dirname+'\'+filepath)
except
On E:Exception do begin
abort;
end;
end;
banjin.N21.Enabled:=true;
liucheng.MenuItem1.Enabled:=true;
yanzheng.N21.Enabled:=true;
banjin.SpeedButton1.Enabled:=true;
liucheng.SpeedButton1.Enabled:=true;
yanzheng.SpeedButton1.Enabled:=true;
banjin.toolbutton1.Enabled:=true;
liucheng.toolbutton1.Enabled:=true;
yanzheng.toolbutton1.Enabled:=true;
if filepath='' then
filespath:=FRootPath+modulname+'\'+pathname+'\'+dirname+'\'+filepath else
filespath:=FRootPath+modulname+'\'+pathname+'\'+dirname+'\'+filepath+'\';
banjin.StatusBar1.Panels[0].Text:='你目前所在的位置:'+filespath;
liucheng.StatusBar1.Panels[0].Text:='你目前所在的位置:'+filespath;
yanzheng.StatusBar1.Panels[0].Text:='你目前所在的位置:'+filespath;
end;
tjff2000 2003-08-26
  • 打赏
  • 举报
回复
e.g:
procedure TForm1.Button1Click(Sender: TObject);
begin
createdir('c:\1');
end;
tjff2000 2003-08-26
  • 打赏
  • 举报
回复
createdir()函数即可。

5,391

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧