QuestionHelpgetting REG_BINARY data from the registry editor into a textbox!

Posts 1–15 of 26 · Page 1 of 2
getting REG_BINARY data from the registry editor into a textbox!
im trying to load the KEY data,




for this example i first use the DATA to load it (because that is in ascii and not in hex binary)





oke let try it out!




it works!

now lets try the KEY data in hex binary!
so i changed the code so it loads the KEY information



oke lets change the code



changed the code! now lets try to run it!



And then i got a error, but i dont know how to fix it

please help me! thanks!
Conversion from type Byte() (array) to 'String' is not valid.

aka. one of the parameters is wrong.



^^If it works for strings, but not "binary data", maybe check the 3rd parameter. I don't think it's supposed to be ""


for the 3rd parameter, type in RegistryValueOptions. (see the period) for available values.

OR, the value being returned can't be assigned to a text box.


i tried binary(i also tried string), but that didnt work... still the: conversion from type 'byte()' to typte 'String' is not valid. Error

why is it that the value cant get into a textbox, its just a key...

also, in what thing(label?) could it be returned?

.Text = An Object

GetValue() Returns OBJECT. .Text is STRING

Dim someBytes() as Byte

someBytes = GetValue() - maybe? apparently it's not a string (.text)
so what do i need to do now..
because i want to get it in a textbox....
and its given me this error:



code i use:
so how do i change it to get it into the textbox! still a hard problem (not the best VB.net coder, just started )

google how to convert an array of bytes into a string. There are ways.

bytes = TextBox1.Text is very very very wrong.

TextBox1.Text = bytes // closer

but u can't set a STRING == to a BYTE (array) . convert the byte array into a string.
ie. .Text = Ascii.FromBytes(bytes) or some other way to convert bytes to strings.


There is no 1 way to do this because 'strings' can be a different data type --> Ascii vs Unicode for example. 1 bytes vs 2 for each letter. You have to understand data types.


datatype = datatype

you can't do

string = byte array


just like you wouldn't do

integer32 = byte array etc etc.

so what do i need to do now.. is a pretty...not good question. NEED is def. the wrong word.
Quote Originally Posted by abuckau907 View Post
google how to convert an array of bytes into a string. There are ways.

bytes = TextBox1.Text is very very very wrong.

TextBox1.Text = bytes // closer

but u can't set a STRING == to a BYTE (array) . convert byte array to string.
yeah im sorry, im not the greatest coder! but i will try to google it!
i googled it, this is what i got..



so when i tried to run and i press the button to get the information.. this is what came out of it



but that is not right...

EDIT: what is at the first sentence is registryvaluekind.binary
I could just paste you the code, but I'm not sure that will fix the root of the problem. I was trying to help you figure it out for yourself. If you have questions: ask, or read. If you haven't learned 1 programming language yet: get a book (buy or library or .pdf) and learn all the aspects of programming before trying to do something extremely specific like access the windows registry.
idk the registry. Look up REG_SZ and REG_BINARY means
Quote Originally Posted by abuckau907 View Post
idk the registry. Look up REG_SZ and REG_BINARY means

REG_SZ is just normal ascii text but REG_BINARY is in hex binary... somehow i need to convert that
define 'what is hex binary' and you'll have the solution
Quote Originally Posted by abuckau907 View Post
define 'what is hex binary' and you'll have the solution
by hex binary i mean:
(REG BINARY) in registry




EDIT: i dont know what in what kind of text its written... but i thought of HEX, like when you use an HEX editor.. if you know what i mean
I know what you meant: "the stuff in the registry under BINARY" ...but do you understand what binary is, and what hex is, and what strings are? You have to understand those first. I'm not sure what else to say, short of posting code.


It's all just bytes. Each 2 letters, ie. 5F, 00, 13, CC, are all just bytes. if it's ascii, 1 bytes = 1 letter

so you must (must?) convert the array of bytes into an array of letters. There must be some .net functions to do this.
Quote Originally Posted by abuckau907 View Post
I know what you meant: "the stuff in the registry under BINARY" ...but do you understand what binary is, and what hex is, and what strings are? You have to understand those first. I'm not sure what else to say, short of posting code.


It's all just bytes. Each 2 letters, ie. 5F, 00, 13, CC, are all just bytes. if it's ascii, 1 bytes = 1 letter

so you must convert the array of bytes into an array of letters. There must be some .net functions to do this.
and thats the problem, i cant convert it, and when i google it my program fills in weird code things. the only thing that i need in my textbox are the 69 13 AC 5F en more that i blurred out
Posts 1–15 of 26 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us