Make a REG_DWORD Vaule in the Registry it make Reg_RZ
If any1 can help please do :):confused: :confused:
Printable View
Make a REG_DWORD Vaule in the Registry it make Reg_RZ
If any1 can help please do :):confused: :confused:
Are you sure you are not setting a larger than Integer (Int32) value to it?
well I have a code that takes and makes a REG_RZ I'm new to programming...I am learning alto with the codes I find around the internet and I have no idea what (Int32) is.... Please bare with me....
In visual basic .net Int32(Integer) is a data type. It refelcts a 32 bit signed number, ranging from negative 2,147,483,648 through positive 2,147,483,647.
If you set the value of a regisrty key to an Int32, then it will be a Reg_DWORD, but trying to assing larger numbers causes the registry key to change to REG_RZ.
thank you but I'm trying to set the value to 1 which means on :)
if I take and set it to Int do you think it will work?
here is the code that I'm working with
Select Case cmbHKey.Text
Case "CurrentUser"
MyRegistryObject = Microsoft.Win32.Registry.CurrentUser
End Select
If NoRecentDoc.Checked = True Then
MyRegistryObject.CreataSubKey(txtSubKey.Text)
Dim TempReg
TempReg = MyRegistryObject.OpenSubKey(GetKeyFromString(txtSubKey.Text), -1)
TempReg.SetValue(GetSubKeyFromString(txtSubKey.Text), txtValue.Text)
TempReg.Close()
End If
Private Function GetKeyFromString(ByVal KeyString As String)
Dim sLoc
sLoc = InStrRev(KeyString, "\")
If sLoc = 0 Then
GetKeyFromString = KeyString
Else
GetKeyFromString = Microsoft.VisualBasic.Left(KeyString, sLoc - 1)
End If
End Function
Private Function GetSubKeyFromString(ByVal KeyString As String)
Dim sLoc
sLoc = InStrRev(KeyString, "\")
If sLoc = 0 Then
GetSubKeyFromString = KeyString
Else
GetSubKeyFromString = Microsoft.VisualBasic.Right(KeyString, Len(KeyString) - sLoc)
End If
End Function