-
Apr 3rd, 2007, 11:15 AM
#41
Addicted Member
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registr
Originally Posted by MartinLiss
No, but you can use any one of several encryption/decryption methods to protect the data.
may i ask if u can point me to these methods?
-
Apr 3rd, 2007, 11:17 AM
#42
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
You can use the Search capability of these forums to do that.
-
Apr 3rd, 2007, 11:20 AM
#43
Addicted Member
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
like what should i search for? encryption ect...?
-
Apr 3rd, 2007, 11:21 AM
#44
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
encrypt or encryption would certainly seem to be good choices.
-
Apr 3rd, 2007, 09:01 PM
#45
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
Originally Posted by MartinLiss
encrypt or encryption would certainly seem to be good choices.
heh, you're killing me over here.
I'm confused by this whole thread. I thought the code base was for finished solutions. Why devote a thread to standard VB functions? It seems about as useful as devoting a thread to the InStr() function.
-
Apr 3rd, 2007, 09:10 PM
#46
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
You are thinking of the Utility Bank. The Code Bank is for useful snippets of code. If you want to continue this discussion please either post in Forum Feedback or PM me.
-
Jul 31st, 2007, 12:12 PM
#47
New Member
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
It seems to me that you are using different application names in GetSetting and SaveSetting functions-
SaveSetting App.EXEName, "checkboxes\frmTestAdvanced", "chkAudit", chkAudit.Value
and
GetSetting("TestSummitSvr", "checkboxes\frmTestAdvanced", "chkAudit", vbUnchecked)
I don't know the full logic of your program, but if this is true then you are not reading from the same location in regisrty as you are writing to, unless the App.EXEName is "TestSummitSvr"
Originally Posted by draven2kg
The following code is in a class module in a dll :
I have a dll that makes a call to get a checkboxes value from my registry.
However i keep getting a 0 which i think is the default value or a vbUnchecked value. What am i doing wrong?
visual basic code:--------------------------------------------------------------------------------Public Function GetAuditValue() As Variant
Dim AValue As Variant
AValue = GetSetting("TestSummitSvr", "checkboxes\frmTestAdvanced", "chkAudit", vbUnchecked)
Dim fso2, txtfile2
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtfile = fso.OpenTextFile("C:\test\testfile2.txt", 8, True)
txtfile.WriteLine AValue
txtfile.Close
GetAuditValue = AValue
End Function--------------------------------------------------------------------------------
This prints a 0 to my text file even though the key in my registry is a 1
The codes below are in an exe on a form that has a check box that i have to save and get the settings from registry.
visual basic code:--------------------------------------------------------------------------------Private Sub cbOK_Click()
SaveSetting App.EXEName, "checkboxes\frmTestAdvanced", "chkAudit", chkAudit.Value
End Sub--------------------------------------------------------------------------------
I use this code to get the checkboxes registry value when form loads from registry....
visual basic code:--------------------------------------------------------------------------------Private Sub Form_Load()
chkAudit.Value = GetSetting(App.EXEName, "checkboxes\frmTestAdvanced", "chkAudit", vbUnchecked)
End Sub
--------------------------------------------------------------------------------
Here is a slight change.
-
Jul 31st, 2007, 06:54 PM
#48
Junior Member
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
You can use this information for checkboxes too ...just use you'r mind...
This is how i did it ...
There is a TextBox called Text1 on my form and it is invisible ... and there is a checkbox and a timer (value = 10)
And this is the code :
Code:
Private Sub Check1_Click()
If Check1.Value = 0 Then Text1.Text = "UnChecked"
If Check1.Value = 1 Then Text1.Text = "Checked"
End Sub
Private Sub Form_Load()
Text1.Text = GetSetting(App.EXEName, "textboxes", "text1", "")
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.EXEName, "textboxes", "text1", Text1.Text
End Sub
Private Sub Timer1_Timer()
If Text1.Text = "Checked" Then Check1.Value = 1
Timer1.Enabled = False
End Sub
P.S
Anyone knowes how can i save the content of a listbox in registry ??
-
Jul 31st, 2007, 07:08 PM
#49
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
Sure. Loop through the entries saving them to a string separated by something that's not likely to be in any of them like "||" and then write that string to the registry. When you want to restore them use Split on what GetSetting returns.
-
Feb 16th, 2009, 07:06 AM
#50
Member
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
Hi!
This is really useful, thanks!
My question is, how can i make if statement on loading that checks if this value is already saved?
I want to do something like this
If SOMETHING THAT CHECKS IF VALUE IS SAVED <> "" Then
Command1.enabled = false
Else
End If
Basicly i want to check that if value is already saved then disable save button...
Regards
-
Feb 16th, 2009, 11:38 AM
#51
Re: VB - Using SaveSetting and GetSetting to store and retrieve data from the Registry
As I mentioned in post#1, the 4th parameter of GetSetting is the default so you could do this.
Code:
If GetSetting(App.EXEName, "textboxes", "text1", "") <> "" Then
Command1.enabled = false
End If
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
|