我想在注册表中单独查询数据部分 [英] I want to query the data part alone in registry

查看:117
本文介绍了我想在注册表中单独查询数据部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
有人可以在这种情况下帮助我吗?

我想查询注册表中的数据.注册表项中的值是随机的.我尝试使用RegQueryValueEx(),因为我必须声明该值(第二个参数).但就我而言,该键的值是随机的.

有人可以帮我查询注册表中的数据吗?


问候
Ron

Hi Guys,
can someone please help me with this scenario.

I want to query the data in the registry.The value in the registry key is random.I tried using RegQueryValueEx(),In that i have to declare the value (2nd parameter). but in my case value for the key is random.

Can someone help me to query the data in the registry.


Regards
Ron

推荐答案

开始
Start here[^], then take a look at the following example, which demonstrates how to retrieve the subkeys of this key, and prints their names to the screen:
[Visual Basic]
Imports System
Imports Microsoft.Win32

Class Reg
    
    Public Shared Sub Main()
        
        ' Create a RegistryKey, which will access the HKEY_USERS
        ' key in the registry of this machine.
        Dim rk As RegistryKey = Registry.Users
        
        ' Print out the keys.
        PrintKeys(rk)
    End Sub    
    
    Shared Sub PrintKeys(rkey As RegistryKey)
        
        ' Retrieve all the subkeys for the specified key.
        Dim names As String() = rkey.GetSubKeyNames()
        
        Dim icount As Integer = 0
        
        Console.WriteLine("Subkeys of " & rkey.Name)
        Console.WriteLine("-----------------------------------------------")
        
        ' Print the contents of the array to the console.
        Dim s As String
        For Each s In  names
            Console.WriteLine(s)
            
            ' The following code puts a limit on the number
            ' of keys displayed.  Comment it out to print the
            ' complete list.
            icount += 1            
            If icount >= 10 Then
                Exit For
            End If
        Next s
    End Sub
End Class


来源:
http://msdn.microsoft.com/zh-cn/library/microsoft.win32.registry%28v = vs.71%29.aspx [


source: http://msdn.microsoft.com/en-us/library/microsoft.win32.registry%28v=vs.71%29.aspx[^]

I hope it will be helpful.


您要

这篇关于我想在注册表中单独查询数据部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆