Also
Function RegistryRetriev e(parent As RegistryKey, keyName As String,
valueName As String) As String
' Recursively search through each subkey of a parent key
' checking to see if a match for the keyname exist and if
' the data can be obtained from that key. Returns data
upon
' match and an error message otherwise.
Dim childName As String
For Each childName In parent.GetSubKe yNames()
Try
Dim child As RegistryKey =
parent.OpenSubK ey(childName)
Dim data As String = Nothing
If child.Name.Ends With(keyName) Then
' We found the name, try to pull out key
data
data = child.GetValue( valueName)
Else
' No luck finding the name, try a
depth-first recursive search
data = RegistryRetriev e(child, keyName,
valueName)
End If
If Not (data Is Nothing) Then
Return data
End If
Catch ex As Exception
' Print out a message whenever we come
across a
' key we don't have permissions to open
Console.WriteLi ne((childName + ": " +
ex.Message))
End Try
Next childName
Return Nothing
End Function
"yxq" <ga***@163.netw rote in message
news:eF******** *****@TK2MSFTNG P02.phx.gbl...
Hello,
I want to get the registry key permission information whether current user
has the permission to delete the registry key using RegistryRights, how to
do? thank you.