Hi Jim
The getsetting was I think the vb6 way to read and write to the registry .Net offers much more flexability.
heres an example of reading and writing to the registry
'read connection string from registry
Public Function GetConnectionString(ByVal strAppID As String) As String
Const CompanyRegistryArea As String = "Insert Registry key(s) here."
Dim strRegPath As String = CompanyRegistryArea & strAppID
Dim RegTemp As RegistryKey
RegTemp = Registry.LocalMachine.OpenSubKey(strRegPath, False)
Return RegTemp.GetValue("ConnectionString", "").ToString
End Function
'write new connection string value to registry
Public Sub SetConnectionString(ByVal strAppID As String, ByVal strNewValue As String)
Const CompanyRegistryArea As String = "Insert Registry key(s) here."
Dim strRegPath As String = CompanyRegistryArea & strAppID
Dim RegTemp As RegistryKey
RegTemp = Registry.LocalMachine.OpenSubKey(strRegPath, True)
RegTemp.SetValue("ConnectionString", strNewValue)
End Sub
Hope this helps
Duncan
|