How to write Binary Data “as is” to Registry (ie: i have visible binary data as string from regedit only)

后端 未结 2 865
面向向阳花
面向向阳花 2021-01-16 05:17

I have been googling this and have not come along a working solution for an entire day. I don\'t know anything about binary data types (as I\'ve never knowingly used them) a

2条回答
  •  情话喂你
    2021-01-16 06:19

    There is no need to use APIs for this. There is a registry class built into the .NET framework

    Try this code and let me know what happens:

    Dim rk = Registry.CurrentUser.OpenSubKey("KEY_TO_OPEN", True)
    rk.SetValue("BinaryValue", New Byte() {10, 43, 44, 45, 14, 255}, _
                RegistryValueKind.Binary)
    rk.Close()
    

    You can also read the Registry documentation on MSDN for more information.

提交回复
热议问题