if FileExists('路径') then MessageBox(0,'存在','提示',MB_OK); //判断文件是否存在 if DirectoryExists('路径') then MessageBox(0,'存在','提示',MB_OK); //判断文件夹(路径)是否存在
解决方案 »
- 请问delphi有没有像JScript那样的单纯输入框?(非窗体的)
- 提问:delphi call java webservice的问题
- 求助!! 怎样让注册表修改后立即起作用
- @@@@@csdn的朋友有谁喜欢玩 百战天虫 online版?
- 有没有什么学习sql2000编程的比较好的例子?
- SQL Server如何在运行的时候恢复数据库?
- Delphi6数据仓库问题
- ado连接通用问题,好多人想知道哦!!!(高分给)
- ◇◇◇ 求Socket写的聊天室程序,要支持多人的
- ADOQuery 和 DBGrid 中用ADOQuery.insert; 插入记录全跑到表格的最后?何故 100分!
- 线程 Abstract Error
- tdxnavbar的风格问题
var
S: String;
I: Integer;
begin
Result := False;
S := FileName;
repeat
I := LastDelimiter('\/', S);
MoveFile(nil, PChar(S));
if (GetLastError = ERROR_ALREADY_EXISTS) or
(
(GetFileAttributes(PChar(Copy(S, I + 1, MaxInt))) = INVALID_FILE_ATTRIBUTES)
and
(GetLastError=ERROR_INVALID_NAME)
) then
Exit;
if I>0 then
S := Copy(S,1,I-1);
until I = 0;
Result := True;
end;