Connecting to the registry

mike55

Well-known member
Joined
Mar 26, 2004
Messages
726
Location
Ireland
Hi all

Have been searching the net today for any good tutorials/resources on how to access the registry for the web.config file as I want to store all my usernames and passwords for getting into the server and the database in the registry in an encrypted form.

Mike55.
 
i can read/delete/write the registry, here is the code

Read
Code:
Dim rk As Microsoft.Win32.RegistryKey
 rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Trelio Software\TBrowser")
homepage.Text = rk.GetValue("startpage")

Write/Delete
Code:
        Dim rk As Microsoft.Win32.RegistryKey
        rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Trelio Software\TBrowser", True)
        rk.DeleteValue("startpage")
        rk.SetValue("startpage", homepage.Text)
        Me.Close()


if thats not it, have you tried the MSDN site ?
 
Last edited by a moderator:
Getox said:
i can read/delete/write the registry, here is the code

Read
Code:
Dim rk As Microsoft.Win32.RegistryKey
 rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Trelio Software\TBrowser")
homepage.Text = rk.GetValue("startpage")

Write/Delete
Code:
        Dim rk As Microsoft.Win32.RegistryKey
        rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Trelio Software\TBrowser", True)
        rk.DeleteValue("startpage")
        rk.SetValue("startpage", homepage.Text)
        Me.Close()


if thats not it, have you tried the MSDN site ?

Ok!, thats grand for getting data into a asp page from the registry, but how do i go about getting that data into the web.config file at start up.

Mike55
 
whats the point of this? Why do you want to store the data in two places? why not just put your data straight in the web.config file...
 
samsmithnz said:
whats the point of this? Why do you want to store the data in two places? why not just put your data straight in the web.config file...

Was told that it was more secure to store server logon info in the registry rather that in the web.config file, so that when the user goes to the web site, the application will firstly go to the registry and get the user name and password and log in to the server and the SQL Server 2000 database.

Mike55.
 
Back
Top