Reading registry values
-
I am trying to get the Computer's name in the registry under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName with the following: string strCompName = (string)Registry.LocalMachine.GetValue("SYSTEM\\ControlSet001\\Control\\ComputerName\\ComputerName\\ComputerName"); But I am getting a null value. BTW I did search the forum, but every post I clicked on from the query sent me to the main forum page. Thanx in advance!
Jude
-
I am trying to get the Computer's name in the registry under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName with the following: string strCompName = (string)Registry.LocalMachine.GetValue("SYSTEM\\ControlSet001\\Control\\ComputerName\\ComputerName\\ComputerName"); But I am getting a null value. BTW I did search the forum, but every post I clicked on from the query sent me to the main forum page. Thanx in advance!
Jude
Figured it out. I thought that RegistryKey.CreateSubKey() would create values, but it reads the subkey.
Jude
-
I am trying to get the Computer's name in the registry under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName with the following: string strCompName = (string)Registry.LocalMachine.GetValue("SYSTEM\\ControlSet001\\Control\\ComputerName\\ComputerName\\ComputerName"); But I am getting a null value. BTW I did search the forum, but every post I clicked on from the query sent me to the main forum page. Thanx in advance!
Jude
This can be accomplished in an easier way:
Environment.MachineName
will return the computers NetBIOS name. (If that's what you're looking for).Kristian Sixhoej
"Failure is not an option" - Gene Kranz
-
This can be accomplished in an easier way:
Environment.MachineName
will return the computers NetBIOS name. (If that's what you're looking for).Kristian Sixhoej
"Failure is not an option" - Gene Kranz
Heh! That easy!?!?! Thanx for the reply. What I am trying to accomplish is connection to an MSDE on the fly. So far I got it working!
Jude
-
Heh! That easy!?!?! Thanx for the reply. What I am trying to accomplish is connection to an MSDE on the fly. So far I got it working!
Jude
Why not just use localhost?
Deja View - the feeling that you've seen this post before.