views:

30

answers:

2

hi guys,

I am trying to read and write values in registry. I get return something like "system.object"{string} from reading function. I need to assign the value to a integer variable.

How can i do it?

+1  A: 
Dim return As Boolean

Dim result as Int

return = Int32.TryParse("yorstring", result)

where return indicates if function can convert string or not

Arseny
Dim result As Int32 would help it compile.
btlog
yeah it worked. thnx for help... i tried doing int32.parse but got error so what's the diff between those 2
KoolKabin
@btlog thanks I fixed it
Arseny
A: 

yes you need to parse it using Int32.TryParse("your string", out result) the function will tell you where you can convert the string to int or not.

Kinjal