|
-
Sep 4th, 2003, 03:14 PM
#1
Thread Starter
New Member
-
Sep 4th, 2003, 04:40 PM
#2
Frenzied Member
Are you sure you are not setting a larger than Integer (Int32) value to it?
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Sep 4th, 2003, 05:31 PM
#3
Thread Starter
New Member
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....
-
Sep 5th, 2003, 11:55 AM
#4
Frenzied Member
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.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Sep 5th, 2003, 12:17 PM
#5
Thread Starter
New Member
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
Last edited by Masta; Sep 5th, 2003 at 12:20 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|