Saturday, 15 May 2010

.net - Label will not set when form loads -



.net - Label will not set when form loads -

i trying set label value of registry key when person loads form sets label there registry key value. doesn't set , default text no key found or error has occurred. first chance exception of type 'system.invalidcastexception' occurred in microsoft.visualbasic.dll error in immediate window.

private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load dim readvalue string readvalue = my.computer.registry.getvalue _ ("hkey_local_machine\software\wow6432node\bohemia interactive studio\arma 2 oa", "key", nothing) label3.text = readvalue end sub

try first:

msgbox("the value " & readvalue)

check if it's @ "key".

then: add together this:

dim bytes byte() = ctype(readvalue, byte()) str = bitconverter.tostring(bytes) label.text = str

.net visual-studio-2010

No comments:

Post a Comment