Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing a DWORD registry value 1

Status
Not open for further replies.

waughp

MIS
Feb 16, 2005
3
US
Hey guys,

I am writting a program in VB.net that needs to set a dword value in the registry. However, it always writes it as a REG_SZ. Here is an example of the code I'm using:

If Me.NovellOptionsCB1.CheckState = CheckState.Checked Then
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey("Software\Novell\Login\", True)
regKey.SetValue("Workstation Only", "dword:1")
End If

Any ideas?

Thanks!
 
haha I got it! the value shouldn't be in quotes for a dword

i.e.

regkey.SetValue("Workstation Only", 1)

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top