7,785
社区成员




Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Sub Command1_Click()
Dim SystemPath As String * 1000, WindowPath As String * 1000
Call GetSystemDirectory(SystemPath, 1000)
SystemPath = Left$(SystemPath, InStr(SystemPath, Chr$(0))) '一般得到C:\WINDOWS\System32
Call GetWindowsDirectory(WindowPath, 1000)
WindowPath = Left$(WindowPath, InStr(WindowPath, Chr$(0))) '一般得到C:\WINDOWS
End Sub