accessing the registry on networked pc's

D

deekay

im trying to create a mini inventory management/asset
management system that gathers pc information for all the
pc connected on a network.

and obviously id like to do this by accessing the
machines registry. these machines dont have the dot net
framework installed so will i still able to use the new
registry namespace in .net, or will i have to use api
calls like in vb6.
 
G

Gary Milton

Just use the Registry namespace. The framework does not need to be
installed on the remote machines whose registry you are interrogating.

Gary
 
K

Ken Tucker [MVP]

Hi,

Try

Dim MyReg As RegistryKey =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, strComputerName)

Dim MyRegKey As RegistryKey

Dim MyVal As String

MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion")

MyVal = MyRegKey.GetValue("ProductID")

MyRegKey.Close()

txtRegistry.Text = MyVal

Catch ex As Exception

Debug.Writeline( ex.Message)

End Try



Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top