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

dondon2001 2001-12-13 10:49:43
VB中如何智能确定,win98安装在哪一个目录下。
...全文
57 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
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")

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧