F
Frederik Jensen
I am currently using OpenNETCF.Win32.Registry to manipulate the
registry on my WinCE4.2 device. It works great but I have one issue I
cannot solve: How do I write multi line string to the registry? In
particulair I want to write an IP address to
LocalMachine\Comm\<wireless adapter name>1\Parms\TcpIp\IpAddress.
Any suggestions? In advance, thank you.
Frederik Jensen, Judex.
--
I tried:
Private Sub myFunc1()
Dim registryKey As OpenNETCF.Win32.RegistryKey
Dim keyName As String = "Comm\PRISMNDS1\Parms\TcpIp"
Dim valueName As String = "IpAddress"
'//Returns error; ArgumentException: value is not supported type
Dim value As Object = New String() {"192", "168", "10", "29"}
'//Saves ordinary string value
'Dim value As String = "192.168.10.29"
registryKey = OpenNETCF.Win32.Registry.LocalMachine.CreateSubKey(keyName)
registryKey.SetValue(valueName, value)
registryKey.Close()
End Sub
After manually setting the IP address (Control Panel\Network and
Dial-up\wireless adapter) I have used Windows CE Remote Registry
Editor to validate that the stored address is of type Multi String.
However, when trying to retrieve the value using myFunc2 the value
returned is Nothing.
Private Sub myFunc2()
Dim registryKey As OpenNETCF.Win32.RegistryKey
Dim keyName As String = "Comm\PRISMNDS1\Parms\TcpIp"
Dim valueName As String = "IpAddress"
registryKey = OpenNETCF.Win32.Registry.LocalMachine.OpenSubKey(keyName)
'//oResponse is Nothing when trying to retrieve Multi String Value
Dim oResponse As Object = registryKey.GetValue("IpAddress")
registryKey.Close()
End Sub
registry on my WinCE4.2 device. It works great but I have one issue I
cannot solve: How do I write multi line string to the registry? In
particulair I want to write an IP address to
LocalMachine\Comm\<wireless adapter name>1\Parms\TcpIp\IpAddress.
Any suggestions? In advance, thank you.
Frederik Jensen, Judex.
--
I tried:
Private Sub myFunc1()
Dim registryKey As OpenNETCF.Win32.RegistryKey
Dim keyName As String = "Comm\PRISMNDS1\Parms\TcpIp"
Dim valueName As String = "IpAddress"
'//Returns error; ArgumentException: value is not supported type
Dim value As Object = New String() {"192", "168", "10", "29"}
'//Saves ordinary string value
'Dim value As String = "192.168.10.29"
registryKey = OpenNETCF.Win32.Registry.LocalMachine.CreateSubKey(keyName)
registryKey.SetValue(valueName, value)
registryKey.Close()
End Sub
After manually setting the IP address (Control Panel\Network and
Dial-up\wireless adapter) I have used Windows CE Remote Registry
Editor to validate that the stored address is of type Multi String.
However, when trying to retrieve the value using myFunc2 the value
returned is Nothing.
Private Sub myFunc2()
Dim registryKey As OpenNETCF.Win32.RegistryKey
Dim keyName As String = "Comm\PRISMNDS1\Parms\TcpIp"
Dim valueName As String = "IpAddress"
registryKey = OpenNETCF.Win32.Registry.LocalMachine.OpenSubKey(keyName)
'//oResponse is Nothing when trying to retrieve Multi String Value
Dim oResponse As Object = registryKey.GetValue("IpAddress")
registryKey.Close()
End Sub