Multi string reading in

  • Thread starter Thread starter Guest
  • Start date Start date
Sorry I forgot to mention LocalMachine>software is in the registry!

So you want to read a REG_MULTI_SZ value from the Registry? Then you
use the Microosft.Win32.RegistryKey class. Cast the return value from
the GetValue method to a String().



Mattias
 
The things is that I use a funtion (below the EM) and it gives the following EM

EM = Conversion from type 'String()' to type 'String' is not valid.


------
Private Function GetDefaultFolderLocation(ByVal sk As String) As String

Dim key As Microsoft.Win32.RegistryKey
key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\NetGearLogReder\Default")
Dim name As String = CType(key.GetValue(sk), String)

' Return the key value to the programe
GetDefaultFolderLocation = name

End Function
 
Dim name As String = CType(key.GetValue(sk), String)

You should cast to a string _array_, not a single string.

Dim names() As String = CType(key.GetValue(sk), String())




Mattias
 
Cheers I will try this out.

Thank You!

Mattias Sjögren said:
You should cast to a string _array_, not a single string.

Dim names() As String = CType(key.GetValue(sk), String())




Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Firefox Multi-Account Containers 1
Multi-Region? 1
Help reading exif info 2
Array Function 9
Splitting string 11
Multi-line comments 8
Multi-dimensional array 5
IPad Multiple Users 0

Back
Top