Scanning/Enumeration of Registry keys
-
Can somebody tell me the code how to scan a registry.
-
Can somebody tell me the code how to scan a registry.
Assuming you're using VB .Net, seeing as you don't actually say, take a look at the Registry classes in the
Microsoft.Win32.Registry
namespace. -
Assuming you're using VB .Net, seeing as you don't actually say, take a look at the Registry classes in the
Microsoft.Win32.Registry
namespace.Hey frnd i want to know that in VB there is no registry inbuilt fn. Rite??? In Vb.net i import namespace imports.win32 tell me dat how to create the object for registry class.
-
Hey frnd i want to know that in VB there is no registry inbuilt fn. Rite??? In Vb.net i import namespace imports.win32 tell me dat how to create the object for registry class.
I'm sorry, I don't understand what you mean. Are you working with Visual Basic .NET or Visual Basic 6 (or earlier)?
-
I'm sorry, I don't understand what you mean. Are you working with Visual Basic .NET or Visual Basic 6 (or earlier)?
I m working with .Net, I want to know from where to start as i do not have any idea.After creating the object,what is the next step.
-
I m working with .Net, I want to know from where to start as i do not have any idea.After creating the object,what is the next step.
As I'm not aware of what your trying to achieve, overall, I can't really suggest anything except taking a look at the MSDN documentation for the classes and finding something that meets your needs. Google is also your friend if you have a specific aim in mind that someone might have done before. Then, if you've got a specific question, ask again. Like most people here I won't give out code until you've got something to show you've had a go yourself first. To give a pointer, though, the Registry Object includes members that encapsulate the various parts of the Registry, and you can loop over them like any other Collection.
-
I m working with .Net, I want to know from where to start as i do not have any idea.After creating the object,what is the next step.
The following code demonstrates how to read a registry entry. You should be able to build on it to incorporate Write, Delete etc.
Public Enum Root As Byte CurrentUser = 1 LocalMachine = 2 CurrentConfig = 3 ClassesRoot = 4 Users = 5 End Enum Function ReadEntry(ByVal RegistryRoot As Root, ByVal Location As String, ByVal Name As String) As String Dim regKey As Microsoft.Win32.RegistryKey Select Case RegistryRoot Case Root.CurrentUser regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(Location) Case Root.LocalMachine regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(Location) Case Root.CurrentConfig regKey = Microsoft.Win32.Registry.CurrentConfig.OpenSubKey(Location) Case Root.ClassesRoot regKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(Location) Case Root.Users regKey = Microsoft.Win32.Registry.Users.OpenSubKey(Location) Case Else regKey = Nothing End Select If regKey Is Nothing Then ReadEntry = Nothing Else Try ReadEntry = regKey.GetValue(Name).ToString regKey.Close() Catch Return Nothing End Try End If End Function
Steve Jowett ------------------------- It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)