Registry help...

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hi,

I have a value stored in the registry "10." and when I extract the stored
value and print it in a text form I only get a figure of "10" and not "10."

why is this so? and how do I get my stored value to print correct? and I
want to treat the value as numeric

thanks

Gary
 
* "Gary said:
I have a value stored in the registry "10." and when I extract the stored
value and print it in a text form I only get a figure of "10" and not "10."

why is this so? and how do I get my stored value to print correct? and I
want to treat the value as numeric

Post the code you use to store/get the value from the registry.
 
thanks for looking at my problem Herfried,

Storing in the registry

regKey3 =
Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\myapp\\Interlock\
\Blank", True)
regKey3.SetValue("Profile", Me.TextBox7.Text)
in this case my textbox7.text value would be "10."



retrieving the info form registry

Public PS

PS = (regKey3.GetValue("Profile"))

PrintLine(2, "Y" & PS)




hope this helps,

Gary
 
Gary said:
Storing in the registry

regKey3 =
Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\myapp\\Interlock\
\Blank", True)

Are doubled "\\" necessary?
regKey3.SetValue("Profile", Me.TextBox7.Text)
in this case my textbox7.text value would be "10."



retrieving the info form registry

Public PS

PS = (regKey3.GetValue("Profile"))

PrintLine(2, "Y" & PS)

First, enable Option Stict. Otherwise it is hard to find the error.
 
* "Gary said:
thanks for looking at my problem Herfried,

Storing in the registry

regKey3 =
Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\myapp\\Interlock\
\Blank", True)

Replace the "\\" with "\".
regKey3.SetValue("Profile", Me.TextBox7.Text)
in this case my textbox7.text value would be "10."

retrieving the info form registry

Public PS

Declare 'PS' as 'String'.

\\\
Public PS As String
///

Then try again.
 
Hi Gary,

Thanks for posting in the group.

Based on my understanding, the question is: You stored 10.0 into registry.
However, when you read it, it turns to 10. Please post here if I have
misunderstood the problem.

I agree with Herfried on his suggestions. Have you tested it? By the way,
what is the parameter type of this key in registry?

Also, I feel we could store it as string in the registry. After reading it
from registry, we could easily change it to a numeric value.

Does that answer your question?

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top