V
visual_cjiajia
Unregistered / Unconfirmed
GUEST, unregistred user!
代码:
1)我在DELPHI中找不到RemoveFile这个API的位置,<br>应该怎么办?<br>2)另外:<br>我用CreateDirectory创建文件夹;系统一直报错,帮我看看我错在哪里?<br>var<br> d:string;<br> ret:BOOL;<br> lpSecurityAttributes :PSecurityAttributes;<br>begin<br>d:=inputbox('输入新文件夹名:','input new dir name:','newfolder');<br>if d<>'' then begin//1<br> try<br> d:= chkpathxie(soucanjia1)+d;<br> lpSecurityAttributes.nLength :=length(d);<br> lpSecurityAttributes.lpSecurityDescriptor:=nil;<br> lpSecurityAttributes.bInheritHandle :=true;<br> ret:=CreateDirectory (pchar(d), lpSecurityAttributes);<br> if ret then<br> dir1.Directory :=d;<br> dir1.Refresh ;<br> except<br> on EAccessViolation do<br> begin<br> exit;<br> end;<br> end;<br> end;//1<br>end;<br>3)为什么我用了RemoveDirectory却不能将一个目录删除?<br>if MessageBox(application.Handle ,pchar('确实要删除?'),<br> pchar('提示'),MB_YESNOCANCEL +MB_ICONERROR)=IDYES then<br>RemoveDirectory(pchar(dir1.Directory ));