dim strsysdir as string
strsysdir = Getsystemdir()
private Function Getsystemidr()'获取系统所在路径
Dim strsysdir AS string *100 '定义长为100的字符串
call getsystemidrectory(strsysdir,100)'调用getsysttemdirectory ,你写错了,这是一个API
Getsystemdir = left $ (strsysdir,instr(strsysdir,vbnullchar)-1)
end function
你的这个例子就是为了取得一个系统路径,不过这个例子写错了,给你个正确的
dim strsysdir as string
strsysdir=Getsystemidr()
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
private Function Getsystemidr()
Dim sSave As String, Ret As Long
sSave = Space(255)
Ret = GetSystemDirectory(sSave, 255)
sSave = Left$(sSave, Ret)
Getsystemidr=sSave
End Sub
a a a a a a