title: I Can't Read registry values from a service
body: <p>Within my service i have the following function in order to take some values from my registry:</p>
  
  <pre><code> Public Function GetKeyValue(ByVal nKey As String, ByVal sPath As String) As String
          Dim RegKey As RegistryKey
          Dim kValue As String = Nothing
          Dim Pos As String
          If CheckRegistry(sPath) Then
              Try
                  RegKey = Registry.CurrentUser.OpenSubKey(sPath)
                  kValue = CStr(RegKey.GetValue(nKey))
  
              Catch ex As Exception
                  StartLogFile(" GetKeyValue " &amp; vbNewLine &amp; "Stack Trace= " &amp; ex.StackTrace, EventLogEntryType.Warning)
              End Try
          End If
          Return kValue
      End Function
  </code></pre>
  
  <p>the same function works fine within a Windows form, but if i call from a service then she can't read the value.
  Is there anybody how knows what is going on?</p>