Private Declare Function GetSystemDirectory Lib "kernel32" Alias _
"GetSystemDirectoryA" (ByVal lpBuffer As String, _
ByVal nSize As Long) As LongPrivate Sub Command1_Click()
Dim i As Long
Dim strPath As String strPath = String(255, 0)
i = GetSystemDirectory(strPath, 256)
strPath = Left(strPath, i)
Debug.Print strPath
End Sub
"GetSystemDirectoryA" (ByVal lpBuffer As String, _
ByVal nSize As Long) As LongPrivate Sub Command1_Click()
Dim i As Long
Dim strPath As String strPath = String(255, 0)
i = GetSystemDirectory(strPath, 256)
strPath = Left(strPath, i)
Debug.Print strPath
End Sub
你也太小气了吧!
可以接受
本来就是来学习的
分数不重要的要得到目录的话,要注意定义好缓冲lpBuffer
要确定可以容纳整个目录
人总是要成长的,让我们大家一起在CSDN里成长为新一代的高手吧!
想吵架的人闪一边去,我们只来学习,不学习的请安静!!!
[email protected]