我一直在寻找最近2个小时,而我似乎只是一直在寻找愚蠢。阅读Registry_binary并转换为字符串
我正在尝试读取Registry_binary值并将其转换为字符串。我试过几件事情,我在网上找到(includeing一些计算器的职位),但看来我无法得到它的工作:
class Class1 {
RegistryKey RegKey;
String keys;
static void Main() {
Class1 c=new Class1();
c.initialize();
}
void initialize() {
RegKey=Registry.LocalMachine.OpenSubKey("the location", true);
var bytearray=Converter<RegKey.GetValue("key"), String[keys]>;
Console.WriteLine(bytearray);
System.Threading.Thread.Sleep(5000);
}
}
我还试图用:
keys=keys+BitConverter.ToString(System.byte[RegKey.GetValue("key")]);
根据要求:
RegKey=Registry.LocalMachine.OpenSubKey("Software\\MXstudios\\riseingtesharts", true);
keys=RegKey.GetValue("key");
,这将输出System.Bytes[]
你想如何将其转换为字符串?你想要什么样的字符串? – SLaks
@SLaks我希望将registry_binary(里面有一个十六进制值)转换为普通文本字符串,如果可能的话用十六进制格式 –
你可以给我们一个registry_binary的例子和预期的结果字符串吗? – deej