您现在的位置:首页 >> 硬件系统 >> 硬件系统 >> 内容

Delphi文件操作所涉及的一些函数(3)

时间:2011/9/3 15:20:08 点击:


  
//删除文件夹 RemoveDir; RemoveDirectory   
var  
  dir: string;   
begin  
  dir := 'c:\temp';   
  RemoveDir(dir); //返回 Boolean   
  
//或者用系统 API:   
  RemoveDirectory(PChar(dir)); //返回 Boolean   
end;    
   

  
//获取当前文件夹 GetCurrentDir   
var  
  dir: string;   
begin  
  dir := GetCurrentDir;   
  ShowMessage(dir); //C:\Projects   
end;    

  
//设置当前文件夹 SetCurrentDir; ChDir; SetCurrentDirectory   
var  
  dir: string;   
begin  
  dir := 'c:\temp';   
  if SetCurrentDir(dir) then  
    ShowMessage(GetCurrentDir); //c:\temp   
  
//或者   
  ChDir(dir); //无返回值   
  
//也可以使用API:   
  SetCurrentDirectory(PChar(Dir)); //返回 Boolean   
end;    
   

上一页1234567下一页

作者:webfly 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号