R
Ray Greene
Are there restrictions on accessing the registry from a web
application?
The following code works from a Windows app but from my web app it
gives the error "Object reference not set to an instance of an object"
when it tries to open the key.
Dim strKey As String = "Software\Microsoft\Internet
Explorer\PageSetup"
Dim oKey As RegistryKey = Registry.CurrentUser.OpenSubKey(strKey)
Dim s As String = oKey.GetValue("header", "")
oKey.Close()
However this code works from the web app:
Dim strKey As String = "Software\Microsoft\Windows NT\currentVersion"
Dim oKey As RegistryKey = Registry.LocalMachine.OpenSubKey(strKey)
Dim s As String = oKey.GetValue("ProductID", "")
oKey.Close()
Can I give the web app rights to open and modify the key?
application?
The following code works from a Windows app but from my web app it
gives the error "Object reference not set to an instance of an object"
when it tries to open the key.
Dim strKey As String = "Software\Microsoft\Internet
Explorer\PageSetup"
Dim oKey As RegistryKey = Registry.CurrentUser.OpenSubKey(strKey)
Dim s As String = oKey.GetValue("header", "")
oKey.Close()
However this code works from the web app:
Dim strKey As String = "Software\Microsoft\Windows NT\currentVersion"
Dim oKey As RegistryKey = Registry.LocalMachine.OpenSubKey(strKey)
Dim s As String = oKey.GetValue("ProductID", "")
oKey.Close()
Can I give the web app rights to open and modify the key?