注册表如何读写reg_bianry数据?
注册表中字符串的读写已经解决,但reg_bianry数据如何读写,有几点疑问:1、注册表中显示的值(hex)和以下语句读取bytevalue的值不一样:
Dim subvalue() As String,currentuser As RegistryKey,bytevalue() As Byte
currentuser = ("Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRULegacy", True)
subvalue = currentuser.GetValueNames
j = subvalue.GetUpperBound(0)
For i = 0 To j
bytevalue = currentuser.GetValue(subvalue(i))
Next
2、如何将bytevalue转换成字符串,用System.Text.Encoding.Unicode.GetString(bytevalue)只能得到一部分;
3、如何写入reg_binary值,以下语句不行
currentuser.SetValue(valuekey, setbytevalue, RegistryValueKind.Binary)
setbytevalue为byte数组