|
注释:复制以下代码到一模块中Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As LongPublic Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long注释:在程序中调用Dim WindowsDirectory As String, SystemDirectory As String, x As LongWindowsDirectory = Space(255)SystemDirectory = Space(255) x = GetWindowsDirectory(WindowsDirectory, 255)x = GetSystemDirectory(SystemDirectory, 255)MsgBox "Windows的安装目录是:" + WindowsDirectory+",系统目录是:" + SystemDirectory |
|
共 1 个关于本帖的回复 最后回复于 2013-7-2 11:44