以文本方式查看主题 - 中文XML论坛 - 专业的XML技术讨论区 (http://bbs.xml.org.cn/index.asp) -- 『 Dot NET,C#,ASP,VB 』 (http://bbs.xml.org.cn/list.asp?boardid=43) ---- 急!急!注册表二进制 读取问题 (http://bbs.xml.org.cn/dispbbs.asp?boardid=43&rootid=&id=47365) |
-- 作者:rryr -- 发布时间:5/22/2007 11:03:00 PM -- 急!急!注册表二进制 读取问题 是对 代理服务器 键值的修改 "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" 下的 DefaultConnectionSettings,修改可以改IE代理,但就是读取显示"尝试读取或写入受保护的内存。这通常指示其他内存已损坏",求大大们帮帮 本人菜鸟一个,没删注释! Text1.Text的内容为 DefaultConnectionSettings 模块: Public Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Integer, ByVal lpSubKey As String, ByVal ulOptions As Integer, ByVal samDesired As Integer, ByRef phkResult As Integer) As Integer '读取注册表的函数 Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" ( _ ByVal hKey As Integer, _ ByVal lpValueName As String, _ ByVal lpReserved As Integer, _ ByVal lpType As Integer, _ ByRef lpData As String, _ ByRef ByreflpcbData As Integer _ ) As Integer ' Note that if you declare the lpData parameter as String, you must pass it By Value. '设置注册表的函数 Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Integer, ByVal lpValueName As String, ByVal Reserved As Integer, ByVal dwType As Integer, ByVal lpData As String, ByVal cbData As Integer) As Integer ' 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 Integer) As Integer Public Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Integer, ByVal lpSubKey As String) As Integer Public Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Integer, ByVal lpValueName As String) As Integer Public Const HKEY_CURRENT_USER = &H80000001 Public Const sKey = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" '这句声明表示是以二进制方式打开注册表 下面是具体写读注册表:问题在1111111111 标记处 |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
62.012ms |