我怎么能转换REG_BINARY值从注册表成字符串? (vb.net) [英] How can I convert a REG_BINARY value from the registry into a string ? (vb.net)

查看:1178
本文介绍了我怎么能转换REG_BINARY值从注册表成字符串? (vb.net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有被存储为一个二进制值(REG_BINARY)持有有关文件路径的信息的注册表值。值被读出到一个字节数组。但我怎么能转换成一个可读的字符串?

I have a registry value which is stored as a binary value (REG_BINARY) holding information about a filepath. The value is read out into an byte array. But how can I transform it into a readable string?

我看了一下system.text.encoding.ASCII.GetString(价值),但这不起作用。至于我认识了注册表值是任意的二进制数据,而不是ASCII这对于法生产无用的数据的原因。

I have read about system.text.encoding.ASCII.GetString(value) but this does not work. As far as I got to know the registry value is arbitrary binary data and not ASCII which is the reason for the method to produce useless data.

是否有人知道我可以转换的数据?

Does anybody know how I can convert the data?

示例:
(一块入口)

Sample: (A piece of the entry)

01 00 00 00 94 00 00 00 14 00 00 00 63 00 3A 00 5C 00 
70 00 72 00 6F 00 67 00 72 00 61 00 6D 00 6d 00 65 00 
5C 00 67 00 65 00 6D 00 65 00 69 00 6E 00 73 00 61 00 
6D 00 65 00 20 00 64 00 61 00 74 00 65 00 69 00 65 00 
6E 00 5C

由于注册表编辑这被认为是:

Due to the regedit this is supposed to be:

............c.:.\.p.r.o.g.r.a.m.m.e.\.g.e.m.e.i.n.s.a.m.e. .d.a.t.e.i.e.n.\

该条目本身是从Outlook中创建。这是一个残疾人插件项目条目(弹性)

The entry itself was created from Outlook. It's an entry for an disabled addin item (resiliency)

推荐答案

好吧,这不是的任意的二进制数据 - 它在文本数据的部分的一种编码。你需要找出编码是什么。

Well, it's not arbitrary binary data - it's text data in some kind of encoding. You need to find out what the encoding is.

我也不会感到惊讶,如果 Encoding.Uni code.GetString(值)工作 - 但如果没有,请张贴样本(以十六进制),我会看到我能做什么。什么是什么的文档的把数据在那里说什么?

I wouldn't be surprised if Encoding.Unicode.GetString(value) worked - but if that doesn't, please post a sample (in hex) and I'll see what I can do. What does the documentation of whatever's put the data in there say?

编辑:它看起来像Encoding.Uni code是你的朋友,但是从12字节使用

It looks like Encoding.Unicode is your friend, but starting from byte 12. Use

Encoding.Unicode.GetString(bytes, 12, bytes.Length-12)

这篇关于我怎么能转换REG_BINARY值从注册表成字符串? (vb.net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆