回复人: zyl910(910:分儿,我来了!) (2002-1-23 22:36:03) 得0分
路径是PathStr
回复人: zyl910(910:分儿,我来了!) (2002-1-23 22:38:37) 得0分
哦!那里还有个错误:
If RegGetStr(HKEY_LOCAL_MACHINE, _
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
路径是PathStr
回复人: zyl910(910:分儿,我来了!) (2002-1-23 22:38:37) 得0分
哦!那里还有个错误:
If RegGetStr(HKEY_LOCAL_MACHINE, _
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
解决方案 »
- vb6中 如何判断 variant变量“不”为空,急。。。。。。。
- 想做一个自动检测硬件,然后安装驱动程序的程序.
- 我装的VB6没有帮助,哪里有?
- 关于textbox的自定义控件(急!!!)
- ==========问题紧急,在线求助========
- VB里调试程序能让VB本生崩溃吗?
- 今天遇到两个面试题,回答比较失败,请高手给我尽量详细的正确处理方法.关于组件开发和sqlserver数据库
- 如何写一个搜索email地址的程序?
- 朋友:请当心这个木马(exploreR.exe) ......
- 我也给分,见者有份
- hhdsq:在窗口最大化时,如何保持窗口高度不变?用Hook
- 怎样生成自定义的打印纸格式??
http://www.sqreg.com/file/vb/reg_01.htm
http://www.sqreg.com/file/vb/reg_02.htm
http://www.sqreg.com/file/vb/reg_03.htm
http://www.sqreg.com/file/vb/reg_04.htm
http://www.sqreg.com/file/vb/reg_05.htm
http://www.sqreg.com/file/vb/reg_06.htm
http://www.sqreg.com/file/vb/reg_07.htm
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
我的PC已安装其路径为"D:\Reader\AcroRd32.exe",程序执行PathStr="" zyl910 错误在哪里?!!
If RegGetStr(HKEY_LOCAL_MACHINE, _
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
'未安装的代码
Else
'已安装的代码
End If
现在程序运行后PathStr="" .....????????????????
Dim PathStr As String
If RegGetStr(HKEY_LOCAL_MACHINE, _
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
MsgBox "B:" + PathStr
Else
MsgBox "A:" + PathStr
End If
If RegGetStr(HKEY_LOCAL_MACHINE, _
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
'未安装的代码
Else
'已安装的代码
End If
哎!我怎么这么 丢三那四。
Dim PathStr As String
If RegGetStr(HKEY_LOCAL_MACHINE, _
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
MsgBox "B:" + PathStr
Else
MsgBox "A:" + PathStr
End If
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
'未安装的代码
'已安装其路径为"D:\Reader\AcroRd32.exe" ,程序运行到此总是PathStr=""
应该 PathStr="D:\Reader\AcroRd32.exe" 才对
Else '已安装的代码
End If
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
'不成功!
Else '成功!进行处理
End If
程序总是执行到 '不成功!PathStr=""
If RegGetStr(HKEY_LOCAL_MACHINE, _
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
IF Rc〈〉0
'不成功!
PathStr="" ELSE '成功!
但始终PathStr="" 我试了几个程序 ???? End If成功 Rc=0 不成功 Rc=2
Dim PathStr As String
If RegGetStr(HKEY_LOCAL_MACHINE, _
"Software\Microsoft\Windows\CurrentVersion\App Paths\Acrord32.exe", _
"Path", PathStr) Then
MsgBox "不成功:" + PathStr
Else
MsgBox "成功:" + PathStr
End If
你是什么操作系统?
Public Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Const HKEY_LOCAL_MACHINE = &H80000002
程序是按您的例子
Option Explicit
Public Const KEY_CREATE_LINK = &H20
Public Const KEY_CREATE_SUB_KEY = &H4
Public Const KEY_ENUMERATE_SUB_KEYS = &H8
Public Const KEY_NOTIFY = &H10
Public Const KEY_QUERY_VALUE = &H1
Public Const KEY_SET_VALUE = &H2
'Public Const KEY_READ = ((STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE))
'Public Const KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE))
'Public Const KEY_EXECUTE = (KEY_READ)
Public Const STANDARD_RIGHTS_ALL = &H1F0000
Public Const SYNCHRONIZE = &H100000
Public Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE))Public Const REG_SZ = 1