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 3490660
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:32:37+00:00 2026-05-18T11:32:37+00:00

These codes allow me to access the registry and grab out the lastvisitedMRU values

  • 0

These codes allow me to access the registry and grab out the lastvisitedMRU values which are in a non-readable format. What I did here was to convert them into a readable format. I placed them in an array and output them into console.

The output goes like this:
C : \ P r o g r a m F i l e s \ i P o d \ f i l e . t x t

How do I remove the spacings in between?

Thanks in advance.

try
        {
            RegistryKey rk = Registry.CurrentUser;

            rk = rk.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedMRU", false);
            PrintKeys(rk);
        }

        catch (Exception MyError)
        {
            Console.WriteLine("An error has occurred: " + MyError.Message);
        }
    }

    static void PrintKeys(RegistryKey rk)
    {
        if (rk == null)
        {
            Console.WriteLine("No specified registry key!");
            return;
        }

        String[] names = rk.GetValueNames();

        Console.WriteLine("Subkeys of " + rk.Name);
        Console.WriteLine("-----------------------------------------------");

        foreach (String s in names)
        {
            try
            {
                if (s == "MRUList")
                {
                    continue;
                }

                else
                {
                    try
                    {
                        Byte[] byteValue = (Byte[])rk.GetValue(s);

                        string str = BitConverter.ToString(byteValue).Replace("00", "");

                        str = BitConverter.ToString(byteValue).Replace("-", "");
        //str binry AND VAR CONVERTED TEXT

                        Console.WriteLine(s + " Contains the value of : " + str);

                        StringBuilder sb = new StringBuilder();

                        for (int i = 0; i <= str.Length - 2; i += 2)
                        {
                            sb.Append(Convert.ToString(Convert.ToChar(Int32.Parse(str.Substring(i, 2), System.Globalization.NumberStyles.HexNumber))));
                        }

                        String val = Convert.ToString(sb).Replace(" ", "");

                        Console.WriteLine(s + " Contains the value of : " + val);
                    }

                    catch (Exception Errors)
                    {
                        Console.WriteLine("An error has occurred: " + Errors.Message);
                    }
                }

                //rk.Close();
            }

            catch (Exception MyError)
            {
                Console.WriteLine("An error has occurred: " + MyError.Message);
            }

            Console.WriteLine("-----------------------------------------------");
            //rk.Close();
        }
  • 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-05-18T11:32:37+00:00Added an answer on May 18, 2026 at 11:32 am

    The binary there is unicode encoded. I fixed your code and verified it is working on my XP. However, it doesn’t work on Windows 7 or Vista because LastVisitedMRU no longer exists.

        static void Main(string[] args)
        {
            try
            {
                RegistryKey rk = Registry.CurrentUser;
                rk = rk.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedMRU", false);
                PrintKeys(rk);
            }
    
            catch (Exception ex)
            {
                Console.WriteLine("An error has occurred: " + ex.Message);
            }
        }
    
        static void PrintKeys(RegistryKey rk)
        {
            if (rk == null)
            {
                Console.WriteLine("No specified registry key!");
                return;
            }
    
            foreach (String s in rk.GetValueNames())
            {
                if (s == "MRUList")
                {
                    continue;
                }
                Byte[] byteValue = (Byte[])rk.GetValue(s);
    
                UnicodeEncoding unicode = new UnicodeEncoding();
                string val = unicode.GetString(byteValue);
    
                Console.Out.WriteLine(val);
            }
            Console.ReadLine();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have these codes for my two tabs. I would like to change the
I created two dropdpwn calendar in my form with these codes: <script type=text/javascript src=http://code.jquery.com/jquery-latest.js></script>
I tried to get avatar at single (post) page by these codes <?php echo
My mainTable has column primaryCode. These codes are incorrect and need to be updated
these below codes give whole data of my Rehber datas. But if i want
We have a couple production servers that are configured to only allow access via
I'm trying to implement an IUserType for states and country codes that will allow
Many Java frameworks allow class members used for injection to be declared non-public. For
QUESTION Which of the Youtube Data API auth methods will allow me to upload
I have some code that I want to only allow access to by one

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.