VB中如何智能确定,win98安装在哪一个目录下。

dondon2001 2001-12-13 10:49:43
VB中如何智能确定,win98安装在哪一个目录下。
...全文
51 4 打赏 收藏 举报
写回复
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
enmity 2001-12-13
  • 打赏
  • 举报
回复
呵呵,对不起,来迟了
enmity 2001-12-13
  • 打赏
  • 举报
回复
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Private sRet As String
Private lRet As Long


Public Sub GetSysFolders(WinSysPath As String, WinPath As String)

sRet = Space(260)
lRet = GetSystemDirectory(sRet, Len(sRet)) 'get the path
WinSysPath = Left(sRet, lRet) 'parse the path into the global string

lRet = GetWindowsDirectory(sRet, Len(sRet)) 'get the path
WinPath = Left(sRet, lRet) 'parse the path to the global string

End Sub
foolishtiger 2001-12-13
  • 打赏
  • 举报
回复
Option Explicit

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

Private Sub Command1_Click()
Dim lngResult As Long
Dim strWinPath As String * 256

lngResult = GetWindowsDirectory(strWinPath, 256)

MsgBox strWinPath
End Sub
Jneu 2001-12-13
  • 打赏
  • 举报
回复
Environ("WinDir")
相关推荐
发帖
VB基础类

7681

社区成员

VB 基础类
社区管理员
  • VB基础类社区
加入社区
帖子事件
创建了帖子
2001-12-13 10:49
社区公告
暂无公告