getdir(0,var s:string);
详细的见delphi 的帮助!

解决方案 »

  1.   

    nanze_xu(梨皮) 不要在这里误导人家呀!
    你说的是查看指定盘符下的当前目录。
      

  2.   

    UINT GetSystemDirectory(    LPTSTR lpBuffer, // address of buffer for system directory 
        UINT uSize  // size of directory buffer 
       ); //取得系统目录
    UINT GetWindowsDirectory(    LPTSTR lpBuffer, // address of buffer for Windows directory 
        UINT uSize  // size of directory buffer 
       ); //取得windows目录
     

    var
      sSystemDirectory : array [0..255] of char;
    begin
       GetSystemDirectory(@sSystemDirectory,255); 
    end;
      

  3.   

    var
      SysPath,WinPath:PChar;
    begin
      GetMem(SysPath,255);
      GetMem(WinPath,255);
      GetSystemDirectory(SysPath,MAX_PATH);
      GetWindowsDirectory(WinPath,MAX_PATH);
      showmessage(SysPath+#13+#10+WinPath);
    end;
    我测试过了,肯定能用!
      

  4.   

    getsystemdirectory()
    用这个函数
      

  5.   

    得到windows目录得到windows目录的方法如下varbuf:array[0..255] of char;begingetwindowsdirectory(buf256);edit1.Text := buf;end;