VB.Net (2005) and using the Registry

One of the decision I made on my program was to use the registry to store my data.  Everyone else does and we are talking 4 small values.  Using the registry with Visual Basic is not hard, just calls.

 

Here’s how I retrieve the registry settings:

 

Me.txtTDD.Text = GetSetting("InfusionSetHelper", "Settings", "TDD", "")
Me.txtDays.Text = GetSetting("InfusionSetHelper", "Settings", "Days", "")
Me.txtTotal.Text = GetSetting("InfusionSetHelper", "Settings", "Total", "")

 

And here’s an example of setting them:

 

SaveSetting("InfusionSetHelper", "Settings", "Days", strDays)

 

Deleting a setting:

 

DeleteSetting("InfusionSetHelper", "Settings", "TDD")

 

While this works and does a nice job, the documentation at http://msdn.microsoft.com/en-us/library/cy6azwf7(VS.80).aspx says to do it another way, and that way is more compatible with Windows Mobile.  I may change this code.