WinAPI: SetCurrentDirectory、GetCurrentDirectory - 设置与获取当前目录

WinAPI: SetCurrentDirectory、GetCurrentDirectory - 设置与获取当前目录
//声明:
SetCurrentDirectory(
  lpPathName: PAnsiChar {路径名}
): BOOL;

GetCurrentDirectory(
  nBufferLength: DWORD; {缓冲区大小}
  lpBuffer: PAnsiChar   {缓冲区}
): DWORD;               {返回目录实际长度}


//举例:
var
  buf: array[0..MAX_PATH] of Char;
begin
  SetCurrentDirectory('c:\temp');

  GetCurrentDirectory(SizeOf(buf), buf);
  ShowMessage(buf); {c:\temp}
end;

posted on 2011-09-12 05:39  delphi初学者  阅读(736)  评论(0编辑  收藏  举报

导航