Results 1 to 3 of 3

Thread: [RESOLVED] Write BINARY value to the registry?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2010
    Posts
    131

    Resolved [RESOLVED] Write BINARY value to the registry?

    I've never worked with Binary values, so I can't get this to work. I don't know how to write it, but when I open the registry, I want the Data to look exactly like this



    My code is
    vb.net Code:
    1. system.SetValue("flcrc", "82, 47, 89, 43, 01, a6, ed, 02, 30, 20, 92, 08, 72", _
    2.  RegistryValueKind.Binary)
    But during runtime I get this error "The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted."
    which makes me guess I must not write the data in that form, but in some other form. What do I need to write to get the above data in a binary type value?

    EDIT:

    Solution:

    So, I got the solution from another thread, what had do be done, was to declare the data as bytes with the ""New Byte () {xx,xx,xx,xx}"
    But the most important thing was to add &H at the start of every single byte value, and the problem is then fixed.
    vb.net Code:
    1. system.SetValue("flcrc", New Byte() {&H82, &H47, &H89, &H43, &H1, &HA6, &HED, &H2, &H30, &H20, &H92, &H8, &H72}, RegistryValueKind.Binary)
    Last edited by Legjendat; Jun 19th, 2011 at 09:57 AM.

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [RESOLVED] Write BINARY value to the registry?

    If you have solved your problem, please post the solution here for others to see, in case someone with the same problem stumbles upon this thread.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2010
    Posts
    131

    Re: [RESOLVED] Write BINARY value to the registry?

    Quote Originally Posted by Atheist View Post
    If you have solved your problem, please post the solution here for others to see, in case someone with the same problem stumbles upon this thread.
    Yeah, OK, done that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width