Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:49:34+00:00 2026-06-09T12:49:34+00:00

I have problem with getting value from binary registry key. My code so far

  • 0

I have problem with getting value from binary registry key.
My code so far is

string key = "UserPreferencesMask";
        string key_place = @"Control Panel\Desktop";
        RegistryKey root = Registry.CurrentUser;
        root = root.OpenSubKey(key_place);
        var byte_value = root.GetValue(key);
        byte[] bytearray = byte_value as byte[];
        //How can convert byte [] array to 64 bit binary string
         klase.Close();
         MessageBox.Show(binary_string);

I am stacked when i want

UserPreferencesMask

binary registry key to convert 64bit binary string . something like this
from

9E3E078012000000

hex value
to

1001111000111110000001111000000000010010000000000000000000000000

binary value

But if i build code which convert from hex to binary, i have wrong binary value if in hex number has first one or two or more zero numbers. Binary returns without first zero numbers, only count start from first byte value with 1 , and has no error if hex started with any other char,except 0
How can i solve problem ? I searched everywhere, but i found only hex to binary ., but this cause an error for me, and returned value aren’t 64 bit value lenght.
Thank’s !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:49:36+00:00Added an answer on June 9, 2026 at 12:49 pm
    Converter.ToString( BitConverter.ToInt64( bytearray, 0 ), 2 ).PadLeft( 64, '0' ); 
    

    If the original number is the wrong endianness then its pretty easy to just do an:

    Array.Reverse( bytearray );
    

    before you run the first line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem getting localized value (a UTF-8 string) from the properties file.
I have no problem getting a value from a text box with some id:
i have a little problem while getting a value from database and post it
I have a problem with getting jquery to retrieve results from a WCF service.
I have a problem with getting value of template field; Gridview is in ContentPlaceHolder1;
Have problem while getting data from Memcached on .NET MVC solution. I have this
I have a bound field in my Gridview which is getting its value from
I have a problem with getting textField value. View : I have Toobar variable
I have a problem with getting a new value of an object. I have
hello i have a problem in getting picture from the url contained in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.