Yes, always keep it on.
And here, you are responsible for converting these values to the appropriate
types. So you can use CType, or the more specialized CBool, CInt, CStr. You
can also do things like Int32.Parse or Int32.TryParse, to actually parse
strings as integers.
These conversions will fail if what you are getting from the registry cannot
be cast as the appropriate type.
You can just construct your own wrapper that has GetValueBoolean, and so on,
where you do all these conversions. Then you just call your own method,
which retrieves the registry key, does the appropriate conversion, checks if
it's empty, and so on.
"Gultekin Komanli" <gk******@gmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi All,
When I use "option strict on" the lines below are producing errors
("implicit conversion").
chkMove.Checked = RegKey.GetValue(C_RK_MOVEFILES, False)
txtUserName.Text = RegKey.GetValue(C_RK_USERNAME, "")
Is there any function like GetValueBoolean, GetValueString for reading
registry keys?
Or should I use CType for conversion ?
Cheers.
Gultekin.
--