Thursday, May 7, 2009

No. of Times Software Use

Private Sub SetNoofTimesSoftwareUse()
Try
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\TEST", True)
Dim i As Object = regKey.GetValue("Id")
If Not i Is DBNull.Value Then
i = Integer.Parse(i) + 1
Else
i = 1
End If
regKey.SetValue("Id", i)
regKey.Close()
Catch
Exit Sub
End Try
End Sub

No comments:

Post a Comment