如何得到windows/ system/ system32 文件夹路径? ( 积分: 10 )

  • 主题发起人 主题发起人 fongling5355
  • 开始时间 开始时间
F

fongling5355

Unregistered / Unconfirmed
GUEST, unregistred user!
如何得到windows/ system/ system32 文件夹路径?
 
如何得到windows/ system/ system32 文件夹路径?
 
//取得WIndows路径、系统路径<br>Function GetWindowsDir : String;<br>Var<br> &nbsp;sTmp : pChar;<br>Begin<br> &nbsp;GetMem(sTmp,255);<br> &nbsp;GetWindowsDirectory(sTmp, 255);<br> &nbsp;Result := sTmp;<br> &nbsp;FreeMem(sTmp);<br>End;<br><br>Function GetSystem32Dir : String;<br>Var<br> &nbsp;sTmp : pChar;<br>Begin<br> &nbsp;GetMem(sTmp,255);<br> &nbsp;GetSystemDirectory(sTmp, 255);<br> &nbsp;Result := sTmp;<br> &nbsp;FreeMem(sTmp);<br>End;
 
var<br>windir:array[0..255]of char;<br>begin<br> &nbsp;GetwindowsDirectory(windir,sizeof(windir));<br> &nbsp;showmessage(windir+'/system/system32/');<br>end;
 
function GetWinSysDir: string;<br>var<br> &nbsp;n: integer;<br> &nbsp;p: PChar;<br>begin<br> &nbsp;n := MAX_PATH;<br> &nbsp;p := stralloc(n);<br> &nbsp;getwindowsdirectory(p, n);<br> &nbsp;result := p + ';';<br> &nbsp;getsystemdirectory(p, n);<br> &nbsp;Result := Result + p + ';';<br>end;
 
多人接受答案了。
 
后退
顶部