hi
why the return value of this function is ZERO
i wrote this code to retrieval a value from registry
attention : the real value of key in the registry is 299
why the return value of this function is ZERO
i wrote this code to retrieval a value from registry
VB.NET:
Imports Microsoft.Win32
Module Variables
Public Function GetTimePassed() As Integer
Dim reg As RegistryKey
Dim Value As Integer
Dim KeyPath As String = "Software\ASW"
Dim KeyName As String = "ASWValue"
Try
reg = Registry.CurrentUser.OpenSubKey(KeyPath, True)
reg.GetValue(KeyName, Value)
reg.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return Value
End Function
End Module
attention : the real value of key in the registry is 299