writing to registry..HELP 
Author Message
 writing to registry..HELP

Hi,

I want to write to a specific are in the registry, but the problem i am
facing is, whenever i write the entry, it gets written as REG_SZ entry, and
not REG_BINARY, which is the way i want.

Below is the code i use.

Thanks,

Ash (See below for the code)

Dim callmethod As RegistryKey
callmethod =
Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Conferencing", True)

callmethod.SetValue("CallingMethod", "01 00 00 00")

callmethod.Close()



Sat, 05 Feb 2005 03:19:30 GMT  
 writing to registry..HELP
Hi,

SetValue uses the type of the thing you are passing to determine what kind
of key to create. Since you passed a string, you got an REG_SZ. With a byte
array, you get REG_BINARY which is what you want.

Dim Bytes As Byte() = {0, 1, 2, 3}

callmethod.SetValue("CallingMethod", Bytes)

Dave Templin
VB.NET Development

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> Hi,

> I want to write to a specific are in the registry, but the problem i am
> facing is, whenever i write the entry, it gets written as REG_SZ entry,
and
> not REG_BINARY, which is the way i want.

> Below is the code i use.

> Thanks,

> Ash (See below for the code)

> Dim callmethod As RegistryKey
> callmethod =
> Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Conferencing", True)

> callmethod.SetValue("CallingMethod", "01 00 00 00")

> callmethod.Close()



Sat, 05 Feb 2005 03:38:45 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Writing a VBS file which reads and writes to the registry

2. Unusual results writing longs to Registry (please help)

3. Help: read or write to the registry

4. help:writing directly to the registry

5. Help with Read/Write Settings to Registry

6. Writing to the Registry via API -- HELP!

7. help:writing directly to the registry

8. Problems writing to NT 4.0 registry - Help

9. Need help on writing binary value to registry

10. Help with a VBS file to read/write to the Registry

11. Need help with reading/writing different registry values

12. Help - VB4 writing into registry

 

 
Powered by phpBB® Forum Software