VB一句话得到当前系统安装目录,VB获取系统目录,VB得到系统目录,VB系统目录,VB GetSystemDirectory。

VB一句话得到当前系统安装目录:

Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Private Sub Form_Load()
Dim e As String
e = Space(255)
MsgBox Left$(e, GetSystemDirectory(e, 255))
End Sub