»ñÈ¡windows°²×°Â·¾¶
ÔÚAccessÖÐÓÃÕâ¸öº¯Êý£º Environ("windir") ¿ÉµÃ³öwindowsµÄ°²×°Â·¾¶ÓÃapi¾ÍÂé·³Ò»µã£º ÔÚÄ£¿éÀïÉùÃ÷APIº¯Êý£º Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long È»ºóÔÚÈÎÒ»¹ý³ÌдÒÔÏÂÓï¾ä£º Dim s As String * 80 Dim Length As Long Dim WinPath As String Dim SysPath As String Length = GetWindowsDirectory(s, Len(s)) WinPath = Left(s, Length) Length = GetSystemDirectory(s, Len(s)) SysPath = Left(s, Length) MsgBox "Windows°²×°Â·¾¶ÊÇ£º" & WinPath MsgBox "system·¾¶ÊÇ£º" & SysPath
--------------------------------------------------------------------------------
Ïà¹ØÎÄÕÂ
ûÓÐÏà¹ØÎÄÕÂ
|